JS技术

javascript 获得客户端硬件信息_javascript教程教程

字号+ 作者:H5之家 来源:H5之家 2015-10-04 11:16 我要评论( )

javascript 获得客户端硬件信息,学习javascript 获得客户端硬件信息,javascript 获得客户端硬件信息,查看javascript 获得客户端硬件信息,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
      <head>
            <title></title>
            <meta content="Microsoft Visual Studio .NET
7.1">
            <meta
content="http://schemas.microsoft.com/intellisense/ie5">
      <script id=clientEventHandlersJS language=javascript>
<!--

function Button2_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("<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 Button1_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("<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 Button1_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("<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 Button1_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("<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 Button1_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("<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>");
}

//-->
</script>
</head>
      <body>
            <INPUT type="button" value="Button"
name="Button1" language=javascript>
      </body>
</html>

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • JavaScript入门教程(二)_javascript教程教程

    JavaScript入门教程(二)_javascript教程教程

    2015-10-10 14:25

  • JavaScript入门教程(五)_javascript教程教程

    JavaScript入门教程(五)_javascript教程教程

    2015-10-10 14:21

  • JavaScript入门教程(四)_javascript教程教程

    JavaScript入门教程(四)_javascript教程教程

    2015-10-10 14:19

  • JavaScript入门教程(三)_javascript教程教程

    JavaScript入门教程(三)_javascript教程教程

    2015-10-10 14:17

网友点评