M
Michael Jackson
I'm using the following code to get the MAC Address from the PC. The actual
MAC Address of the PC is 8th and 9th in the list (following the code). How
do I get just the MAC Address I need? Why are there so many entries?
Dim objManagementClass As New ManagementClass(New
ManagementPath("Win32_NetworkAdapter"))
Dim colManagementObjects As ManagementObjectCollection =
objManagementClass.GetInstances
For Each objMO As ManagementObject In colManagementObjects
Me.lstGeneric.Items.Add(IIf(IsNothing(objMO("MACAddress")), "Nothing",
objMO("MACAddress")))
Next
Output from the code is:
Nothing
20:41:53:59:4E:FF
Nothing
50:50:54:50:30:30
33:50:6F:45:30:30
Nothing
Nothing
00:0D:61:26:94:C8
00:0D:61:26:94:C8
62:FF:20:52:41:53
Nothing
Thanks,
Michael
MAC Address of the PC is 8th and 9th in the list (following the code). How
do I get just the MAC Address I need? Why are there so many entries?
Dim objManagementClass As New ManagementClass(New
ManagementPath("Win32_NetworkAdapter"))
Dim colManagementObjects As ManagementObjectCollection =
objManagementClass.GetInstances
For Each objMO As ManagementObject In colManagementObjects
Me.lstGeneric.Items.Add(IIf(IsNothing(objMO("MACAddress")), "Nothing",
objMO("MACAddress")))
Next
Output from the code is:
Nothing
20:41:53:59:4E:FF
Nothing
50:50:54:50:30:30
33:50:6F:45:30:30
Nothing
Nothing
00:0D:61:26:94:C8
00:0D:61:26:94:C8
62:FF:20:52:41:53
Nothing
Thanks,
Michael