LOGO OA教程 ERP教程 模切知识交流 PMS教程 CRM教程 开发文档 其他文档  
 
网站管理员

JS获取硬件信息代码

admin
2017年12月3日 2:46 本文热度 5128
<html>
<head>
<title>javascript获得客户端硬件信息-www.web2bar.cn/</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">

<script id=clientEventHandlersJS language=javascript>
<!--
function Button1_onclick() {//CPU 信息
   var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
   var service = locator.ConnectServer(".");
   var properties = service.ExecQuery("SELECT * FROM Win32_Processor");
   var e = new Enumerator (properties);
      document.write("CPU信息");
   document.write("<table border=1>");
   for (;!e.atEnd();e.moveNext ())
   {
      var p = e.item ();
      document.write("<tr>");
      document.write("<td>" + p.Caption + "</td>");
      document.write("<td>" + p.DeviceID + "</td>");
      document.write("<td>" + p.Name + "</td>");
      document.write("<td>" + p.CpuStatus + "</td>");
      document.write("<td>" + p.Availability + "</td>");
      document.write("<td>" + p.Level + "</td>");
      document.write("<td>" + p.ProcessorID + "</td>");
      document.write("<td>" + p.SystemName + "</td>");
      document.write("<td>" + p.ProcessorType + "</td>");
      document.write("</tr>");
   }
   document.write("</table>");
}
  
function Button2_onclick() {//软盘信息
   var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
   var service = locator.ConnectServer(".");
   var properties = service.ExecQuery("SELECT * FROM Win32_FloppyDrive");
   var e = new Enumerator (properties);
      document.write("软盘信息");
   document.write("<table border=1>");
   for (;!e.atEnd();e.moveNext ())
   {
      var p = e.item ();
      document.write("<tr>");
      document.write("<td>" + p.Description + "</td>");
      document.write("<td>" + p.DeviceID + "</td>");
      document.write("<td>" + p.Status + "</td>");
      document.write("<td>" + p.Manufacuturer + "</td>");
      document.write("</tr>");
   }
   document.write("</table>");
}
  
function Button3_onclick() {//CD-ROM 信息
   var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
   var service = locator.ConnectServer(".");
   var properties = service.ExecQuery("SELECT * FROM Win32_CDROMDrive");
   var e = new Enumerator (properties);
      document.write("CD-ROM信息");
   document.write("<table border=1>");
   for (;!e.atEnd();e.moveNext ())
   {
      var p = e.item ();
      document.write("<tr>");
      document.write("<td>" + p.Caption + "</td>");
      document.write("<td>" + p.Description + "</td>");
      document.write("<td>" + p.Drive + "</td>");
      document.write("<td>" + p.Status + "</td>");
      document.write("<td>" + p.MediaLoaded + "</td>");
      document.write("</tr>");
   }
   document.write("</table>");
}
  
function Button4_onclick() {//键盘信息
   var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
   var service = locator.ConnectServer(".");
   var properties = service.ExecQuery("SELECT * FROM Win32_Keyboard");
   var e = new Enumerator (properties);
      document.write("键盘信息");
   document.write("<table border=1>");
   for (;!e.atEnd();e.moveNext ())
   {
      var p = e.item ();
      document.write("<tr>");
      document.write("<td>" + p.Description + "</td>");
      document.write("<td>" + p.Name + "</td>");
      document.write("<td>" + p.Status + "</td>");
      document.write("</tr>");
   }
   document.write("</table>");
}
  
function Button5_onclick() {//主板信息
   var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
   var service = locator.ConnectServer(".");
   var properties = service.ExecQuery("SELECT * FROM Win32_BaseBoard");
   var e = new Enumerator (properties);
      document.write("主板信息");
   document.write("<table border=1>");
   for (;!e.atEnd();e.moveNext ())
   {
      var p = e.item ();
      document.write("<tr>");
      document.write("<td>" + p.HostingBoard + "</td>");
      document.write("<td>" + p.Manufacturer + "</td>");
      document.write("<td>" + p.PoweredOn + "</td>");
      document.write("<td>" + p.Product + "</td>");
      document.write("<td>" + p.SerialNumber + "</td>");
      document.write("<td>" + p.Version + "</td>");
      document.write("</tr>");
   }
   document.write("</table>");
}

function Button6_onclick() {//硬盘序列号 信息
   var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
   var service = locator.ConnectServer(".");
   var properties = service.ExecQuery("SELECT * FROM Win32_DiskDrive");
   var e = new Enumerator (properties);
      document.write("硬盘信息");
   document.write("<table border=1>");
   for (;!e.atEnd();e.moveNext ())
   {
      var p = e.item ();
      document.write("<tr>");
      document.write("<td>" + p.signature + "</td>");
      document.write("</tr>");
   }
   document.write("</table>");
}

function Button7_onclick() {//内存 信息
   var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
   var service = locator.ConnectServer(".");
   var properties = service.ExecQuery("SELECT * FROM Win32_ComputerSystem");
   var e = new Enumerator (properties);
      document.write("内存信息");
   document.write("<table border=1>");
   for (;!e.atEnd();e.moveNext ())
   {
      var p = e.item ();
      document.write("<tr>");
      document.write("<td>" + Math.ceil(p.TotalPhysicalMemory / 1024 / 1024 / 1024) + "</td>");
      document.write("</tr>");
   }
   document.write("</table>");
}
Button1_onclick();
Button3_onclick();
Button4_onclick();
Button5_onclick();
Button6_onclick();
Button7_onclick();
//-->
</script>
</head>

<body>
</body>
</html>

该文章在 2017/12/3 2:46:50 编辑过
关键字查询
相关文章
正在查询...
点晴ERP是一款针对中小制造业的专业生产管理软件系统,系统成熟度和易用性得到了国内大量中小企业的青睐。
点晴PMS码头管理系统主要针对港口码头集装箱与散货日常运作、调度、堆场、车队、财务费用、相关报表等业务管理,结合码头的业务特点,围绕调度、堆场作业而开发的。集技术的先进性、管理的有效性于一体,是物流码头及其他港口类企业的高效ERP管理信息系统。
点晴WMS仓储管理系统提供了货物产品管理,销售管理,采购管理,仓储管理,仓库管理,保质期管理,货位管理,库位管理,生产管理,WMS管理系统,标签打印,条形码,二维码管理,批号管理软件。
点晴免费OA是一款软件和通用服务都免费,不限功能、不限时间、不限用户的免费OA协同办公管理系统。
Copyright 2010-2024 ClickSun All Rights Reserved