JS获取PC终端系统信息

获取终端信息

</span></p><p><span style="white-space: nowrap;"><!--</span></p><p><span style="white-space: nowrap;">function Button2_onclick() {//CPU 信息</span></p><p><span style="white-space: nowrap;">var locator = new ActiveXObject</span></p><p><span style="white-space: nowrap;">("WbemScripting.SWbemLocator");</span></p><p><span style="white-space: nowrap;">var service = locator.ConnectServer(".");</span></p><p><span style="white-space: nowrap;">var properties = service.ExecQuery</span></p><p><span style="white-space: nowrap;">("SELECT * FROM Win32_Processor");</span></p><p><span style="white-space: nowrap;">var e = new Enumerator (properties);</span></p><p><span style="white-space: nowrap;">document.write("<table border=1>");</span></p><p><span style="white-space: nowrap;">for (;!e.atEnd();e.moveNext ())</span></p><p><span style="white-space: nowrap;">      {</span></p><p><span style="white-space: nowrap;">var p = e.item ();</span></p><p><span style="white-space: nowrap;">document.write("<tr>");</span></p><p><span style="white-space: nowrap;">document.write("<td>"+p.Caption+"</td>");</span></p><p><span style="white-space: nowrap;">document.write("<td>"+p.DeviceID+"</td>");</span></p><p><span style="white-space: nowrap;">document.write("<td>"+p.Name+"</td>");</span></p><p><span style="white-space: nowrap;">document.write("<td>"+p.CpuStatus+"</td>");</span></p><p><span style="white-space: nowrap;">document.write("<td>"+p.Availability+"</td>");</span></p><p><span style="white-space: nowrap;">document.write("<td>"+p.Level+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">  </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.ProcessorID+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.SystemName+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.ProcessorType+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("</tr>");</span></p><p><span style="white-space: nowrap;">      }</span></p><p><span style="white-space: nowrap;">      document.write("</table>");</span></p><p><span style="white-space: nowrap;">}</span></p><p><span style="white-space: nowrap;">function Button1_onclick() {//主板信息</span></p><p><span style="white-space: nowrap;">var locator = new ActiveXObject </span></p><p><span style="white-space: nowrap;">("WbemScripting.SWbemLocator");</span></p><p><span style="white-space: nowrap;">var service = locator.ConnectServer(".");</span></p><p><span style="white-space: nowrap;">var properties = service.ExecQuery</span></p><p><span style="white-space: nowrap;">("SELECT * FROM Win32_BaseBoard");</span></p><p><span style="white-space: nowrap;">var e = new Enumerator (properties);</span></p><p><span style="white-space: nowrap;">document.write("<table border=1>");</span></p><p><span style="white-space: nowrap;">for (;!e.atEnd();e.moveNext ())</span></p><p><span style="white-space: nowrap;">      {</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">var p = e.item ();</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<tr>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.HostingBoard+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.Manufacturer+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.PoweredOn+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.Product+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.SerialNumber+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.Version+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("</tr>");</span></p><p><span style="white-space: nowrap;">      }</span></p><p><span style="white-space: nowrap;">      document.write("</table>");</span></p><p><span style="white-space: nowrap;">}</span></p><p><span style="white-space: nowrap;">function Button3_onclick() {//网络信息</span></p><p><span style="white-space: nowrap;">var locator = new ActiveXObject </span></p><p><span style="white-space: nowrap;">("WbemScripting.SWbemLocator");</span></p><p><span style="white-space: nowrap;">var service = locator.ConnectServer(".");</span></p><p><span style="white-space: nowrap;">var properties = service.ExecQuery</span></p><p><span style="white-space: nowrap;">("SELECT*FROM</span></p><p><span style="white-space: nowrap;">win32_networkadapterconfiguration");</span></p><p><span style="white-space: nowrap;">var e = new Enumerator (properties);</span></p><p><span style="white-space: nowrap;">document.write("<table border=1>");</span></p><p><span style="white-space: nowrap;">      for (;!e.atEnd();e.moveNext ())</span></p><p><span style="white-space: nowrap;">      {</span></p><p><span style="white-space: nowrap;">       var p = e.item ();</span></p><p><span style="white-space: nowrap;">       if (p.IPAddress==null) {</span></p><p><span style="white-space: nowrap;">             continue;</span></p><p><span style="white-space: nowrap;">            }</span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<tr>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.Caption+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.IPAddress(0)+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.MACAddress+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("</tr>");</span></p><p><span style="white-space: nowrap;">      }</span></p><p><span style="white-space: nowrap;">      document.write("</table>");</span></p><p><span style="white-space: nowrap;">}</span></p><p><span style="white-space: nowrap;">function Button4_onclick() {//系统信息</span></p><p><span style="white-space: nowrap;">var locator = new ActiveXObject </span></p><p><span style="white-space: nowrap;">("WbemScripting.SWbemLocator");</span></p><p><span style="white-space: nowrap;">var service = locator.ConnectServer(".");</span></p><p><span style="white-space: nowrap;">var properties = service.ExecQuery</span></p><p><span style="white-space: nowrap;">("SELECT * FROM Win32_ComputerSystem");</span></p><p><span style="white-space: nowrap;">var e = new Enumerator (properties);</span></p><p><span style="white-space: nowrap;">document.write("<table border=1>");</span></p><p><span style="white-space: nowrap;">      for (;!e.atEnd();e.moveNext ())</span></p><p><span style="white-space: nowrap;">      {</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">var p = e.item ();</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<tr>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.Caption+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.UserName+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.Name+"</td>");</span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.PrimaryOwnerName+"");</span><span style="white-space: nowrap; line-height: 1.42857;">      </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.Manufacturer+"</td>");    </span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("<td>"+p.DNSHostName+"</td>");              </span><span style="white-space: nowrap; line-height: 1.42857;">       </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">document.write("</tr>");</span></p><p><span style="white-space: nowrap;">      }</span></p><p><span style="white-space: nowrap;">      document.write("</table>");</span></p><p><span style="white-space: nowrap;">}</span></p><p><span style="white-space: nowrap;">//--></span></p><p><span style="white-space: nowrap;">

 

name="Button1"language=javascript 

onclick="return Button1_onclick()">

name="Button3"language=javascript 

onclick="return Button3_onclick()">

name="Button4"language=javascript 

onclick="return Button4_onclick()">

 

本文地址:http://www.vnote.net/index.php?m=Home&c=Article&a=index&id=36


回复列表



回复操作

正在加载验证码......

请先拖动验证码到相应位置

发布时间:2015-11-20 12:27:59

修改时间:2015-11-20 12:27:59

查看次数:1138

评论次数:0