本帖最后由 dreamneo 于 2013-7-24 00:02 编辑
通过WMI方式获得的CPUID (ProcessorId)不是唯一的?
我有两台电脑,型号都一样,通过WMI获得的CPUID也是一样的!
请问CPU有唯一的标识的东西吗?
搜索了一下,CPUID是存在重复的,看大家都说MAC物理地址,决定两个一起用,做个机器识别的
要做程序注册用!__wmi_Win32_Processor()
msgbox(0,"",$Output)
Func __wmi_Win32_Processor()
Local $wbemFlagReturnImmediately = 0x10
Local $wbemFlagForwardOnly = 0x20
Local $colItems = ""
Local $strComputer = "localhost"
Local $Output = ""
Local $objWMIService = ObjGet("winmgmts:\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) Then
For $objItem In $colItems
$Output = $objItem.ProcessorId
Next
Else
$Output = '没有在类 "Win32_Processor" 中找到WMI对象'
EndIf
Return $Output
EndFunc ;==>__wmi_Win32_Processor
|