Obtaining the NIC number from a PC

  • Thread starter Thread starter Tim Marsden
  • Start date Start date
T

Tim Marsden

Using VB.NET How do I obtain the NIC number of a particular PC or Server.
(By NIC I am refering to the unique network card ID)

Thanks
Tim
 
Raghavendra
Many thanks for your swift reply,

Have you any code examples of the API in use ?

Regards
Tim
 
Hi,
Check this one out:

-- Code Start --
Dim mc As ManagementClass = New
ManagementClass("Win32_NetworkAdapterConfiguration")
Dim moc As ManagementObjectCollection = mc.GetInstances()
For Each mo As ManagementObject in moc
If (CType(mo("IPEnabled"), Boolean)) Then Console.WriteLine
(mo("MacAddress").ToString())
Next
moc.Dispose()
mc.Dispose()
-- Code End --

Using VB.NET How do I obtain the NIC number of a particular PC or Server.
(By NIC I am refering to the unique network card ID)

Thanks
Tim
 
Thanks

I have resolved this issue using the System.Management functionality
suggested.

Tim
 
Back
Top