<!DOCTYPE html>
<html>
<head>
<title>获取电脑硬件信息</title>
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=GBK">
</head>
<body>
<script id="clientEventHandlersJS" language="javascript" charset="utf-8">
[url]http://www.w3school.com.cn/htmldom/dom_obj_navigator.asp[/url]
/******************************************以上为浏览器信息,以下为pc信息************************************************/ try { var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
//获取网络连接信息
function ipinfo(){
var properties = service.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE");
var e = new Enumerator (properties);
var info="<table border=1>";
info+="<tr bgcolor='#CDEDED' style='font-weight: bold;' >
<td width='450'>网络连接信息:</td></tr>";
var i=1;
for (;!e.atEnd();e.moveNext ()){
var p = e.item ();
info+="<tr style='color: red'><td >MAC地址"+i+":" + p.MACAddress + "</td></tr>"; info+="<tr style='color: red'><td >IP地址"+i+":" + p.IPAddress(0) + "</td></tr>"; i++; }
info+="</table>"; return info; }
function pcInfo() {//所有信息
var info=ipinfo();
/* info+=disk(); info+=raminfo();
info+=mainBoard();
info+=ipinfo();
info+=keyBoardInfo();
info+=RomInfo();
info+=softDisk(); */ document.getElementById('elInfo').innerHTML=info;
return info; } } catch (e) { document.write(e); }
/******************************************以上为pc信息************************************************/
</script>
</head>
<body > <!-- <INPUT id="Button1" type="button" value="浏览器所有信息" name="Button1" language=javascript onclick="allinfo()"> -->
<INPUT id="Button1" type="button" value="客户端pc信息" name="Button1" language=javascript onclick="pcInfo()">
<div id="elInfo" >
</div> </body> </html>