<HTML>
Save the preceding Code as an HTML file during use.
WMI is used to obtain the hardware and system information of the Client Computer: 1 // obtain the system information
2 function getsysinfo (){
3 var locator = new activexobject ("wbemscripting. swbemlocator ");
4 var service = locator. connectserver (".");
5 // CPU Information
6 var CPU = new enumerator (service. execquery ("select * From win32_processor"). Item ();
7 var cputype = CPU. Name, hostname = CPU. systemname;
8 // memory information
9 var memory = new enumerator (service. execquery ("select * From win32_physicalmemory "));
10 For (VAR mem = [], I = 0 ;! Memory. atend (); memory. movenext () MEm [I ++] = {CAP: memory. item (). capacity/1024/1024, speed: memory. item (). speed}
11 // system information
12 var system = new enumerator (service. execquery ("select * From win32_computersystem"). Item ();
13 var physicmencap = math. Ceil (system. totalphysicalmemory/1024/1024), curuser = system. username, cpucount = system. numberofprocessors
14
15 return {cputype: cputype, cpucount: cpucount, hostname: Hostname, curuser: curuser, memcap: physicmencap, Mem: Mem}
16}