本帖最后由 3mile 于 2010-10-28 09:34 编辑
不知道任务管理器中表现内存如何啊?
用wmi来获取试试:
; 生成于 AutoIt Scriptomatic
__wmi_Win32_PhysicalMemory()
Func __wmi_Win32_PhysicalMemory()
Local $wbemFlagReturnImmediately = 0x10
Local $wbemFlagForwardOnly = 0x20
Local $colItems = ""
Local $strComputer = "localhost"
Local $Output=""
$Output &= "Computer: " & $strComputer & @CRLF
$Output &= "==========================================" & @CRLF
Local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMemory", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$Output &= "BankLabel: " & $objItem.BankLabel & @CRLF
$Output &= "Capacity: " & $objItem.Capacity & @CRLF
$Output &= "Caption: " & $objItem.Caption & @CRLF
$Output &= "CreationClassName: " & $objItem.CreationClassName & @CRLF
$Output &= "DataWidth: " & $objItem.DataWidth & @CRLF
$Output &= "Description: " & $objItem.Description & @CRLF
$Output &= "DeviceLocator: " & $objItem.DeviceLocator & @CRLF
$Output &= "FormFactor: " & $objItem.FormFactor & @CRLF
$Output &= "HotSwappable: " & $objItem.HotSwappable & @CRLF
$Output &= "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
$Output &= "InterleaveDataDepth: " & $objItem.InterleaveDataDepth & @CRLF
$Output &= "InterleavePosition: " & $objItem.InterleavePosition & @CRLF
$Output &= "Manufacturer: " & $objItem.Manufacturer & @CRLF
$Output &= "MemoryType: " & $objItem.MemoryType & @CRLF
$Output &= "Model: " & $objItem.Model & @CRLF
$Output &= "Name: " & $objItem.Name & @CRLF
$Output &= "OtherIdentifyingInfo: " & $objItem.OtherIdentifyingInfo & @CRLF
$Output &= "PartNumber: " & $objItem.PartNumber & @CRLF
$Output &= "PositionInRow: " & $objItem.PositionInRow & @CRLF
$Output &= "PoweredOn: " & $objItem.PoweredOn & @CRLF
$Output &= "Removable: " & $objItem.Removable & @CRLF
$Output &= "Replaceable: " & $objItem.Replaceable & @CRLF
$Output &= "SerialNumber: " & $objItem.SerialNumber & @CRLF
$Output &= "SKU: " & $objItem.SKU & @CRLF
$Output &= "Speed: " & $objItem.Speed & @CRLF
$Output &= "Status: " & $objItem.Status & @CRLF
$Output &= "Tag: " & $objItem.Tag & @CRLF
$Output &= "TotalWidth: " & $objItem.TotalWidth & @CRLF
$Output &= "TypeDetail: " & $objItem.TypeDetail & @CRLF
$Output &= "Version: " & $objItem.Version & @CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
Else
Msgbox(0,"WMI 输出","没有在类 " & "Win32_PhysicalMemory" & "中找到WMI对象" )
Endif
EndFunc
Func WMIDateStringToDate($dtmDate)
Return (StringMid($dtmDate, 5, 2) & "/" & _
StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc
|