Obtaining Hardware ID

  • Thread starter Thread starter citationcj2
  • Start date Start date
C

citationcj2

Does anyone know how to obtain the hardware ID from the system using VB.net
I have looked and haven't found much on it at all... Or tell me if its even possible.

Thanks
 
Just a guess, as I don't know what a "hardware ID" is, look at
System.Management. Lot's of fun stuff in there anyway.
 
Hi,

You can get that information with the wmi. Add a reference to
system.management.dll to you app. Here is an example.


Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_PNPEntity")

moReturn = moSearch.Get

For Each mo In moReturn

Dim strOut As String = String.Format(" {0} - {1} ", mo("Name"),
mo("DeviceID"))

Debug.WriteLine(strout)

Next



For More Info on the wmi hardware classes

http://msdn.microsoft.com/library/d...isdk/wmi/computer_system_hardware_classes.asp



Ken
 
Back
Top