.net获取硬件信息_CPU序列号
(编辑:jimmy 日期: 2024/11/17 浏览:3 次 )
复制代码 代码如下:
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
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
下一篇:asp.net 删除,更新数据库方法