欢迎光临
我们一直在努力

通过WMI获得硬盘和CPU的物理序列号(VB.net)-.NET教程,VB.Net语言

建站超值云服务器,限时71元/月

获得硬盘序列号

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;

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 通过WMI获得硬盘和CPU的物理序列号(VB.net)-.NET教程,VB.Net语言
分享到: 更多 (0)