VB 通过wmi获取主板序列号为空
用的是VBA
代码如下
Set obj3 = GetObject( "winmgmts: ").InstancesOf( "Select SerialNumber From Win32_BIOS ")
For Each objx In obj3
Enum3 = "Win32_BaseBoard= " + objx.SerialNumber
Next
MsgBox Enum3
这个也不行
Set obj3 = GetObject( "winmgmts: ").InstancesOf( "Win32_BaseBoard ")
For Each objx In obj3
Enum3 = "Win32_BIOS= " + objx.SerialNumber
Next
MsgBox Enum3
[解决办法]
哈 有点难度。。
[解决办法]
并非所有主板都可以的
[解决办法]
有的主板是检测不到ID的,有的没有ID
[解决办法]
wmi只能在nt4.0以上的操作系统运行 98 和 me肯定不好用 搂住要加密可以采用我博客的硬盘物理序列号的方法
[解决办法]
但有的读不出硬盘物理序列号
[解决办法]
读取系统所在的盘序列号就行~~~
主板的序列号存在能读和不能读的问题。
[解决办法]
Function Comput()
On Error Resume Next
strComputer = ". "
Set objWMIService = GetObject( "winmgmts:\\ " & strComputer & "\root\cimv2 ")
Set colItems = objWMIService.ExecQuery( "Select * from Win32_BaseBoard ", , 48)
For Each objItem In colItems
Debug.Print "Caption: " & objItem.Caption
Debug.Print "ConfigOptions: " & objItem.ConfigOptions
Debug.Print "CreationClassName: " & objItem.CreationClassName
Debug.Print "Depth: " & objItem.Depth
Debug.Print "Description: " & objItem.Description
Debug.Print "Height: " & objItem.Height
Debug.Print "HostingBoard: " & objItem.HostingBoard
Debug.Print "HotSwappable: " & objItem.HotSwappable
Debug.Print "InstallDate: " & objItem.InstallDate
Debug.Print "Manufacturer: " & objItem.Manufacturer
Debug.Print "Model: " & objItem.Model
Debug.Print "Name: " & objItem.Name
Debug.Print "OtherIdentifyingInf " & objItem.OtherIdentifyingInfo
Debug.Print "PartNumber: " & objItem.PartNumber
Debug.Print "PoweredOn: " & objItem.PoweredOn
Debug.Print "Product: " & objItem.Product
Debug.Print "Removable: " & objItem.Removable
Debug.Print "Replaceable: " & objItem.Replaceable
Debug.Print "RequirementsDescription: " & objItem.RequirementsDescription
Debug.Print "RequiresDaughterBoard: " & objItem.RequiresDaughterBoard
Debug.Print "SerialNumber: " & objItem.SerialNumber
Debug.Print "SKU: " & objItem.SKU
Debug.Print "SlotLayout: " & objItem.SlotLayout
Debug.Print "SpecialRequirements: " & objItem.SpecialRequirements
Debug.Print "Status: " & objItem.Status
Debug.Print "Tag: " & objItem.Tag
Debug.Print "Version: " & objItem.Version
Debug.Print "Weight: " & objItem.Weight
Debug.Print "Width: " & objItem.Width
Debug.Print
Next
End Function
[解决办法]
帮你顶一下