P
Pioneer
Hi,
I need to get MAC address/physical ip address of machine. I am using
below code:
ManagementClass mc = new ManagementClass("Win32_NetworkAdapter");
foreach (ManagementObject mo in mc.GetInstances())
{
string macAddr = mo["MACAddress"] as string;
if ( macAddr != null && macAddr.Trim() != "" )
return macAddr.ToString();
}
But this returns multiple IP addresses out of which Physical address
is shown twice and rest of the addresses I could not find in
ipconfig/
all command output on cmd.
Could you help me understand the output?
I only want the physical address. IF there is any better alternative,
kindly let me know.
Thanks
Pioneer
I need to get MAC address/physical ip address of machine. I am using
below code:
ManagementClass mc = new ManagementClass("Win32_NetworkAdapter");
foreach (ManagementObject mo in mc.GetInstances())
{
string macAddr = mo["MACAddress"] as string;
if ( macAddr != null && macAddr.Trim() != "" )
return macAddr.ToString();
}
But this returns multiple IP addresses out of which Physical address
is shown twice and rest of the addresses I could not find in
ipconfig/
all command output on cmd.
Could you help me understand the output?
I only want the physical address. IF there is any better alternative,
kindly let me know.
Thanks
Pioneer