Getcpuid.dll 获取的id只有8位, 而使用 Microsoft WMI Scripting Library 可以识别到16 位,下面简短的代码返回的是16位16进制的字符串。
' 首先必须引用 Microsoft WMI Scripting Library
Option Compare Database
Sub wmiProcessorID()
Dim cpuSet As SWbemObjectSet
Dim cpu As SWbemObject
Set cpuSet = GetObject("winmgmts:{impersonationLevel=impersonate}"). _
InstancesOf("Win32_Processor")
For Each cpu In cpuSet
MsgBox cpu.ProcessorId
Next
End Sub