欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

.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