If you want to get a remote address, you need to use the Sendarp function. The specific code is as follows:
[DLLIMPORT ("iPhlpapi.dll")]]]]]
Private Static Unsafe Extern Int Sendarp (INT32 DEST, INT32 HOST, REF INTPTR MAC, Ref INTPTR LENGTH);
[DLLIMPORT ("WS2_32.dll")]]]
Private static extern INT32 INET_ADDR (String IP);
INT32 LDEST = INET_ADDR ("157.60.68.163"); // Destination IP
INT32 LHOST = INET_ADDR ("157.60.68.33"); // Local IP
Try
{
Byte [] macinfo = new byte [6];
INT32 Length = 6;
INTPTR MAC = New INTPTR (MacInfo [0]);
INTPTR LEN = New INTPTR (6);
INT II = Sendarp (LDEST, LHOST, REF MAC, REF LEN);
Console.WriteLine ("Mac Add:" Mac);
Console.writeline ("Length:" LEN);
}
Catch (Exception Err)
{
Console.writeLine (ERR);
}