D
DaTurk
Hi,
I want to to find the Mac address of the NIC being used by a given
process using a corresponding IP address. It should be pointed out
that the machines that this program will be running on will be using
more then one NIC. SO I have to use the IP adress to get the correct
MAC. Here is the code I'm using to get the IP. Any help would be
greatly appreciated, and thank you in advance.
public static IPAddress GetLocalIP()
{
IPAddress localIp = null;
String hostName = Dns.GetHostName();
IPHostEntry ipHostEntry = Dns.GetHostByName(hostName);
if( ipHostEntry.AddressList.Length >= 1 )
{
localIp = ipHostEntry.AddressList[0];
}
return localIp;
}
I know I'm just grabbing the first one, but for the purposes of the
program it doesn't really matter. But it does matter that the Mac
Address I grab correspond to this IP I'm grabbing here. Thanks again
I want to to find the Mac address of the NIC being used by a given
process using a corresponding IP address. It should be pointed out
that the machines that this program will be running on will be using
more then one NIC. SO I have to use the IP adress to get the correct
MAC. Here is the code I'm using to get the IP. Any help would be
greatly appreciated, and thank you in advance.
public static IPAddress GetLocalIP()
{
IPAddress localIp = null;
String hostName = Dns.GetHostName();
IPHostEntry ipHostEntry = Dns.GetHostByName(hostName);
if( ipHostEntry.AddressList.Length >= 1 )
{
localIp = ipHostEntry.AddressList[0];
}
return localIp;
}
I know I'm just grabbing the first one, but for the purposes of the
program it doesn't really matter. But it does matter that the Mac
Address I grab correspond to this IP I'm grabbing here. Thanks again