电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

通过WMI获得硬盘和CPU的物理序列号


发布日期:2020/5/8
 
获得硬盘序列号

Dim cmicWmi As New SystemManagementManagementObjectSearcher(SELECT * FROM Win_DiskDrive)

Dim Uint As UInt

For Each cmicWmiObj As ManagementObject In cmicWmiGet

Uint = cmicWmiObj(signature)

Next

TextBoxText = UintToString

获得CPU序列号

Dim Wmi As New SystemManagementManagementObjectSearcher(SELECT * FROM Win_Processor)

Dim Uint As String

For Each WmiObj As ManagementObject In WmiGet

Uint = WmiObj(ProcessorId)

Next

TextBoxText = Uint

获得硬盘总容量

Dim Wmi As New SystemManagementManagementObjectSearcher(SELECT * FROM Win_DiskDrive)

Dim Uint As UInt

For Each WmiObj As ManagementObject In WmiGet

Uint = WmiObj(size)

Next

TextBoxText = UintToString

首先引用SystemManagement然后在代码中Imports SystemManagement

上一篇:session定义使用和丢失问题小结

下一篇:myPage分页控件 v2.0.0.2版本