AU3如何获取CPU型号[已解决]
本帖最后由 dyd 于 2011-5-7 09:58 编辑求获取CPU型号源码 @CPUArch 版主正解。。。。。。 @CPUArch,也是刚知道。 谢谢谢谢,我试试 这个只能知道CPU架构,我想知道CPU的型号,如Pentium(r) cpu 2.8GHz #include <array.au3>
Global $wbemFlagReturnImmediately = 0x10, _ ;DO NOT CHANGE
$wbemFlagForwardOnly = 0x20 ;DO NOT CHANGE
local $aa
_ComputerGetProcessors($aa)
_ArrayDisplay($aa)
Func _ComputerGetProcessors(ByRef $aProcessorInfo)
Local $colItems, $objWMIService, $objItem
Dim $aProcessorInfo, $i = 1
$objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) Then
For $objItem In $colItems
ReDim $aProcessorInfo
$aProcessorInfo[$i]= StringStripWS($objItem.Name, 1)
$aProcessorInfo[$i]= $objItem.AddressWidth
$aProcessorInfo[$i]= $objItem.Architecture
$aProcessorInfo[$i]= $objItem.Availability
$aProcessorInfo[$i]= $objItem.Description
$aProcessorInfo[$i]= $objItem.ConfigManagerErrorCode
$aProcessorInfo[$i]= $objItem.ConfigManagerUserConfig
$aProcessorInfo[$i]= $objItem.CpuStatus
$aProcessorInfo[$i]= $objItem.CreationClassName
$aProcessorInfo[$i]= $objItem.CurrentClockSpeed
$aProcessorInfo[$i] = $objItem.CurrentVoltage
$aProcessorInfo[$i] = $objItem.DataWidth
$aProcessorInfo[$i] = $objItem.DeviceID
$aProcessorInfo[$i] = $objItem.ErrorCleared
$aProcessorInfo[$i] = $objItem.ErrorDescription
$aProcessorInfo[$i] = $objItem.ExtClock
$aProcessorInfo[$i] = $objItem.Family
$aProcessorInfo[$i] = $objItem.L2CacheSize
$aProcessorInfo[$i] = $objItem.L2CacheSpeed
$aProcessorInfo[$i] = $objItem.LastErrorCode
$aProcessorInfo[$i] = $objItem.Level
$aProcessorInfo[$i] = $objItem.LoadPercentage
$aProcessorInfo[$i] = $objItem.Manufacturer
$aProcessorInfo[$i] = $objItem.MaxClockSpeed
$aProcessorInfo[$i] = $objItem.OtherFamilyDescription
$aProcessorInfo[$i] = $objItem.PNPDeviceID
$aProcessorInfo[$i] = $objItem.PowerManagementCapabilities(0)
$aProcessorInfo[$i] = $objItem.PowerManagementSupported
$aProcessorInfo[$i] = $objItem.ProcessorId
$aProcessorInfo[$i] = $objItem.ProcessorType
$aProcessorInfo[$i] = $objItem.Revision
$aProcessorInfo[$i] = $objItem.Role
$aProcessorInfo[$i] = $objItem.SocketDesignation
$aProcessorInfo[$i] = $objItem.Status
$aProcessorInfo[$i] = $objItem.StatusInfo
$aProcessorInfo[$i] = $objItem.Stepping
$aProcessorInfo[$i] = $objItem.SystemCreationClassName
$aProcessorInfo[$i] = $objItem.SystemName
$aProcessorInfo[$i] = $objItem.UniqueId
$aProcessorInfo[$i] = $objItem.UpgradeMethod
$aProcessorInfo[$i] = $objItem.Version
$aProcessorInfo[$i] = $objItem.VoltageCaps
$i += 1
Next
$aProcessorInfo = UBound($aProcessorInfo) - 1
If $aProcessorInfo < 1 Then
SetError(1, 1, 0)
EndIf
Else
SetError(1, 2, 0)
EndIf
EndFunc ;_ComputerGetProcessors Local $i,$j
$i=RegRead ("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString" )
$j=RegRead ("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\1", "ProcessorNameString" )
If $i <> "" Then
MsgBox(0,"","本机的CPU型号为:"&$i)
Else
MsgBox(0,"","本机的CPU型号为:"&$j)
EndIf
知道以后,楼主打算做什么呢 3smile强大 很好的帖子 很好的问题 真的很不錯,經常上論壇能學到很多東西 很好的东西,学习了。 不错又学到一招 楼主所指的型号是些什么参数
页:
[1]
2