#include "FiveWin.Ch"
FUNCTION main()
LOCAL oLoc,oWmi,oLis, oObj
LOCAL nTotal:=0,nLibre:=0
oLoc := CreateObject( "wbemScripting.SwbemLocator" )
oWmi := oLoc:ConnectServer()
oLis := oWmi:ExecQuery( "SELECT * FROM Win32_ComputerSystem" )
FOR EACH oObj IN oLis
nTotal+=Val( oObj:TotalPhysicalMemory ) //Valor en Bytes
NEXT
nTotal:=nTotal/1024 //Convertimos a KB
oLis := oWmi:ExecQuery( "SELECT * FROM Win32_OperatingSystem" )
FOR EACH oObj IN oLis
nLibre+=Val( oObj:FreePhysicalMemory ) //Valor en KB
NEXT
? 'Memoria física total(KB):'+Str(nTotal),;
'Memoria física libre(KB):'+Str(nLibre),;
'% memoria ocupada :'+Str(100-((nLibre*100)/nTotal))
RETURN NIL
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 53 guests