Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Amount of RAM?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01325584
Message ID:
01325587
Vues:
18
>When I right mouse click on My Computer on the General tab I see that I have 1.50 GB of RAM installed. How can I get that information via an API or other method? The MEMORY() and some other SYS() functions did not return the information I desire.

You can try with WMI
loLocator	= CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI		= loLocator.ConnectServer()
loOSs		= loWMI.ExecQuery('Select * from Win32_OperatingSystem')
for each loOS in loOSs
	with loOS
		? .FreePhysicalMemory, .FreeVirtualMemory
	endwith
endfor
[Update]

Ooops, RAM installed... Should read carefully Hugo...
loLocator	= CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI		= loLocator.ConnectServer()
loCSs		= loWMI.ExecQuery('Select * from Win32_ComputerSystem')
for each loCS in loCSs
	with loCS
		? .TotalPhysicalMemory
	endwith
endfor
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform