Understanding MAC Addresses
I want to use the MAC address for hardware authentication purposes. I found this (slightly modified) code on the web:
PHP Code:
private void btnGetMACAddress_Click(object sender, System.EventArgs e)
{
ManagementObjectSearcher query = null;
ManagementObjectCollection queryCollection = null;
try
{
query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration") ;
queryCollection = query.Get();
foreach( ManagementObject mo in queryCollection )
{
if(mo["MacAddress"] != null)
{
MessageBox.Show(mo["MacAddress"].ToString());
}
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Source);
MessageBox.Show(ex.Message);
}
}
Now, that code seems to work just fine. But, it shows 5 MAC addresses on my machine. In my network connections, I have four "LAN or High-Speed Internet" connections. ipconfig /all shows me two connections (the two that are currently enabled). getmac from a command line shows me four connections, two that are enabled (so I get the MAC addresses for them).
Anyone know where the fifth MAC address is coming from?
Thanks,
Mike