首页 > 编程 > .NET > 正文

.net获取硬件信息_CPU序列号

2024-07-10 13:19:34
字体:
来源:转载
供稿:网友

复制代码 代码如下:


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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表