论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > javascript教程教程
Tag:验证,特效,入门,实例,验证,表单,特效,正则表达式,跑马灯,document,函数,代码,getElementByID,菜单,图片,视频教程

javascript 获得客户端硬件信息

文章类别:javascript教程 | 发表日期:2008-10-5 17:47:57

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
      <head>
            <title></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 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 id="Button1" type="button" value="Button"
name="Button1" language=javascript onclick="return Button1_onclick()">
      </body>
</html>

上一篇:JavaScript控制鼠标滑轮事件 人气:4804
下一篇:javascript类设计模式 人气:5645
视频教程列表
文章教程搜索
 
Javascript推荐教程
Javascript热门教程