T
Toma Marinov
Hello !
First, excuse me for my not very good english! >:O(
With this code below, I retrieve the MAC address of my
network card from WMI class Win32_NetworkAdapter, and add
it to ListBox :
String strSQL;
ObjectQuery objQry = null;
ManagementObjectSearcher objSearcher = null;
strSQL = "SELECT * FROM Win32_NetworkAdapter ";
objQry = new ObjectQuery (strSQL);
objSearcher = new ManagementObjectSearcher (objQry);
this.lbMac .Items.Clear ();
foreach (ManagementObject objM in objSearcher.Get ())
{
if (objM["MACAddress"] != null)
{
this.lbMac.Items.Add (objM["MACAddress"].ToString());
}
}//FOR
This work, but the problem is that the result is six MAC
addresses, but I have only one network card. And only the
first address is the address if my network card.
Can someone tell me - from where the rest 5 MAC addresses
appear ?
Thank you !
Toma Marinov
First, excuse me for my not very good english! >:O(
With this code below, I retrieve the MAC address of my
network card from WMI class Win32_NetworkAdapter, and add
it to ListBox :
String strSQL;
ObjectQuery objQry = null;
ManagementObjectSearcher objSearcher = null;
strSQL = "SELECT * FROM Win32_NetworkAdapter ";
objQry = new ObjectQuery (strSQL);
objSearcher = new ManagementObjectSearcher (objQry);
this.lbMac .Items.Clear ();
foreach (ManagementObject objM in objSearcher.Get ())
{
if (objM["MACAddress"] != null)
{
this.lbMac.Items.Add (objM["MACAddress"].ToString());
}
}//FOR
This work, but the problem is that the result is six MAC
addresses, but I have only one network card. And only the
first address is the address if my network card.
Can someone tell me - from where the rest 5 MAC addresses
appear ?
Thank you !
Toma Marinov