HOW TO: Retrieve this machine hardware information
Use managementclass. The following example is to retrieve hard disk information.
Private sub button1_click (byvale as system.object, byval e as system.eventargs) Handles Button1.click
DIM Disks as new managementClassClass ("Win32_DiskDrive")
DIM OBSERVER AS New ManagementOperationObserver
AddHandler Observer.ObjectReady, Addressof OnenumObjectReady
Disks.getinstances (Observer)
End Sub
Sub OnenumObjectReady (Byval E as ObjectReadyeventargs)
Console.writeline ("************************************************** ********* ")
Console.writeline (E.NewObject.properties ("description"). Value)
Console.writeline (E.Newobject.properties ("caption"). Value)
Console.writeLine (E.NewObject.properties ("DeviceID"). Value)
End Sub