只需一步,快速开始
highflybird 发表于 2012-7-24 05:19
使用道具 举报
//系统信息获取 function getSysInfo(){ var locator = new ActiveXObject ("WbemScripting.SWbemLocator"); var service = locator.ConnectServer("."); //CPU信息 var cpu = new Enumerator (service.ExecQuery("SELECT * FROM Win32_Processor")).item(); var cpuType=cpu.Name,hostName=cpu.SystemName; //内存信息 var memory = new Enumerator (service.ExecQuery("SELECT * FROM Win32_PhysicalMemory")); for (var mem=[],i=0; !memory.atEnd(); memory.moveNext()) mem[i++]={cap:memory.item().Capacity/1024/1024,speed:memory.item().Speed} //系统信息 var system=new Enumerator (service.ExecQuery("SELECT * FROM Win32_ComputerSystem")).item(); var physicMenCap=Math.ceil(system.TotalPhysicalMemory/1024/1024),curUser=system.UserName,cpuCount=system.NumberOfProcessors return {cpuType:cpuType,cpuCount:cpuCount,hostName:hostName,curUser:curUser,memCap:physicMenCap,mem:mem} } //系统信息获取 function getSysInfo(){ var locator = new ActiveXObject ("WbemScripting.SWbemLocator"); var service = locator.ConnectServer("."); //CPU信息 var cpu = new Enumerator (service.ExecQuery("SELECT * FROM Win32_Processor")).item(); var cpuType=cpu.Name,hostName=cpu.SystemName; //内存信息 var memory = new Enumerator (service.ExecQuery("SELECT * FROM Win32_PhysicalMemory")); for (var mem=[],i=0; !memory.atEnd(); memory.moveNext()) mem[i++]={cap:memory.item().Capacity/1024/1024,speed:memory.item().Speed} //系统信息 var system=new Enumerator (service.ExecQuery("SELECT * FROM Win32_ComputerSystem")).item(); var physicMenCap=Math.ceil(system.TotalPhysicalMemory/1024/1024),curUser=system.UserName,cpuCount=system.NumberOfProcessors return {cpuType:cpuType,cpuCount:cpuCount,hostName:hostName,curUser:curUser,memCap:physicMenCap,mem:mem} }
highflybir 发表于 2012-7-23 15:22 仅仅在64位上win7 ,IE8测试通过,未测试其他版本。
sunny20102 发表于 2012-7-24 14:45 To 15# 在第一行加入 (vl-load-com) 再试试
半听可乐 发表于 2012-7-24 15:02 还是不行,问题依旧
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 ) ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
GMT+8, 2024-11-17 00:56 , Processed in 0.161495 second(s), 21 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.