.net获取硬件信息_CPU序列号
程序员文章站
2024-03-11 12:55:19
复制代码 代码如下:public sub getcpuid() try dim mc as management.managementclass dim moc as ma...
复制代码 代码如下:
public sub getcpuid()
try
dim mc as management.managementclass
dim moc as management.managementobjectcollection
dim mo as management.managementobject
mc = new management.managementclass("win32_processor")
moc = mc.getinstances()
for each mo in moc
strcpuid = mo.properties("processorid").value.tostring()
next mo
catch ex as exception
msgbox(ex.message)
end try
end sub