获得硬盘序列号
dim cmicwmi as new system.management.managementobjectsearcher("select * from win32_diskdrive")
dim uint32 as uint32
for each cmicwmiobj as managementobject in cmicwmi.get
uint32 = cmicwmiobj("signature")
next
textbox1.text = uint32.tostring
获得cpu序列号
dim wmi as new system.management.managementobjectsearcher("select * from win32_processor")
dim uint32 as string
for each wmiobj as managementobject in wmi.get
uint32 = wmiobj("processorid")
next
textbox1.text = uint32
获得硬盘总容量
dim wmi as new system.management.managementobjectsearcher("select * from win32_diskdrive")
dim uint64 as uint64
for each wmiobj as managementobject in wmi.get
uint64 = wmiobj("size")
next
textbox1.text = uint64.tostring
首先,引用system.management;然后在代码中imports system.management;