<html>
<head>
<style type='text/css'>
body{font-size:12px;}
body table tr td{font-size:12px;}
</style>
<script>
var info = allinfo();
//document.write(info);
var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
info = pcInfo();
document.write(info);
//获取浏览器相关信息
function allinfo(){
var userLanguage = navigator.userLanguage; // 用户在自己的操作系统上设置的语言(火狐没有)
var userAgent = navigator.userAgent; //包含以下属性中所有或一部分的字符串:appCodeName,appName,appVersion,language,platform
var systemLanguage = navigator.systemLanguage; // 用户操作系统 支持的默认语言(火狐没有)
info+="浏览器属性信息: "+userAgent+"<br />";
info+="用户设置的操作系统语言: "+userLanguage+"<br />";
info+="操作系统支持的默认语言: "+systemLanguage+"<br />";
return info;
}
/******************************************以上为浏览器信息,以下为pc信息************************************************/
function cpuInfo() {//CPU 信息
var properties = service.ExecQuery("SELECT * FROM Win32_Processor");
var e = new Enumerator (properties);
var info = "<table border=1>";
info+="<tr bgcolor='#CDEDED' style='font-weight: bold;' ><td width='450' >CPU 信息</td></tr>";
for (;!e.atEnd();e.moveNext ()) {
var p = e.item ();
info+="<tr style='color: red'><td >CPU序列号:" + p.ProcessorID + "</td></tr>";
info+="<tr><td >"+p.Caption+"</td></tr>";
info+="<tr><td >CPU编号:"+p.DeviceID+"</td></tr>";
info+="<tr><td >CPU型号:" + p.Name + "</td></tr>";
info+="<tr><td >CPU状态:" + p.CpuStatus + "</td></tr>";
info+="<tr><td >CPU可用性:" + p.Availability + "</td></tr>";
info+="<tr><td >CUP Level:" + p.Level + "</td></tr>";
info+="<tr><td >主机名称:" + p.SystemName + "</td></tr>";
info+="<tr><td >Processor Type:" + p.ProcessorType + "</td></tr>";
}
info+="</table>";
return info;
}
function mainBoard() {//主板信息
var properties = service.ExecQuery("SELECT * FROM Win32_BaseBoard");
var e = new Enumerator (properties);
var info="<table border=1>";
info+="<tr bgcolor='#CDEDED' style='font-weight: bold;'><td width='450'>主板信息 </td></tr>";
for (;!e.atEnd();e.moveNext ()) {
var p = e.item ();
info+="<tr style='color: red'><td >主板ID:" + p.SerialNumber + "</td></tr>";
info+="<tr><td >" + p.HostingBoard + "</td></tr>";
info+="<tr><td >制造商:" + p.Manufacturer + "</td></tr>";
info+="<tr><td >是否开启:" + p.PoweredOn + "</td></tr>";
info+="<tr><td >型号:" + p.Product + "</td></tr>";
info+="<tr><td >版本:" + p.Version + "</td></tr>";
}
info+="</table>";
return info;
}
function CDROMDrive() {//光驱信息
var properties = service.ExecQuery("SELECT * FROM Win32_CDROMDrive");
var e = new Enumerator (properties);
var info="<table border=1>";
info+="<tr bgcolor='#CDEDED' style='font-weight: bold;'><td width='450'>光驱信息 </td></tr>";
for (;!e.atEnd();e.moveNext ()) {
var p = e.item ();
info+="<tr style='color: red'><td >DeviceID:" + p.DeviceID + "</td></tr>";
info+="<tr><td >Caption:" + p.Caption + "</td></tr>";
info+="<tr><td >Name:" + p.Name + "</td></tr>";
info+="<tr><td >Drive:" + p.Drive + "</td></tr>";
info+="<tr><td > DeviceID:" + p. DeviceID + "</td></tr>";
info+="<tr><td > Status:" + p. Status + "</td></tr>";
info+="<tr><td>VolumeName:"+p.VolumeName+"</td></tr>"
}
info+="</table>";
return info;
}
function diskDrive() {//硬盘信息
var properties = service.ExecQuery("SELECT * FROM Win32_DiskDrive");
var e = new Enumerator (properties);
var info="<table border=1>";
info+="<tr bgcolor='#CDEDED' style='font-weight: bold;'><td width='450'>硬盘信息 </td></tr>";
for (;!e.atEnd();e.moveNext ()) {
var p = e.item ();
info+="<tr style='color: red'><td >DeviceID:" + p.DeviceID + "</td></tr>";
info+="<tr><td >Caption:" + p.Caption + "</td></tr>";
info+="<tr><td >Name:" + p.Name + "</td></tr>";
info+="<tr><td >Drive:" + p.Drive + "</td></tr>";
info+="<tr><td > Description:" + p.Description + "</td></tr>";
info+="<tr><td > Status:" + p. Status + "</td></tr>";
info+="<tr><td > SerialNumber:" + p.SerialNumber + "</td></tr>";
info+="<tr><td > InterfaceType:" + p.InterfaceType + "</td></tr>";
info+="<tr><td > Model:" + p.Model + "</td></tr>";
info+="<tr><td > Index:" + p.Index + "</td></tr>";
info+="<tr><td>Size:"+p.Size+"</td></tr>"
}
info+="</table>";
return info;
}
function keyBoard() {//键盘信息
var properties = service.ExecQuery("SELECT * FROM Win32_Keyboard");
var e = new Enumerator (properties);
var info="<table border=1>";
info+="<tr bgcolor='#CDEDED' style='font-weight: bold;'><td width='450'>键盘信息 </td></tr>";
for (;!e.atEnd();e.moveNext ()) {
var p = e.item ();
info+="<tr style='color: red'><td >Description:" + p.Description + "</td></tr>";
info+="<tr><td >Status:" + p.Status + "</td></tr>";
info+="<tr><td >Name:" + p.Name + "</td></tr>";
}
info+="</table>";
return info;
}
function pointingDevice() {//点输入设备 鼠标
var properties = service.ExecQuery("SELECT * FROM Win32_PointingDevice");
var e = new Enumerator (properties);
var info="<table border=1>";
info+="<tr bgcolor='#CDEDED' style='font-weight: bold;'><td width='450'>点输入设备 鼠标信息</td></tr>";
for (;!e.atEnd();e.moveNext ()) {
var p = e.item ();
info+="<tr style='color:red'><td >Description:" + p.Description + "</td></tr>";
info+="<tr><td >Status:" + p.Status + "</td></tr>";
info+="<tr><td >Name:" + p.Name + "</td></tr>";
}
info+="</table>";
return info;
}
function BIOS() {//BIOS信息
var properties = service.ExecQuery("SELECT * FROM Win32_BIOS ");
var e = new Enumerator (properties);
var info="<table border=1>";
info+="<tr bgcolor='#CDEDED' style='font-weight: bold;'><td width='450'>BIOS信息</td></tr>";
for (;!e.atEnd();e.moveNext ()) {
var p = e.item ();
info+="<tr style='color: red'><td >BuildNumber:" + p.BuildNumber + "</td></tr>";
info+="<tr><td >Caption:" + p.Caption + "</td></tr>";
info+="<tr><td >CodeSet:" + p.CodeSet + "</td></tr>";
info+="<tr><td >CurrentLanguage:" + p.CurrentLanguage + "</td></tr>";
info+="<tr><td >Description:" + p.Description + "</td></tr>";
info+="<tr><td >Name:" + p.Name + "</td></tr>";
info+="<tr><td >PrimaryBIOS:" + p.PrimaryBIOS + "</td></tr>";
info+="<tr><td >SerialNumber:" + p.SerialNumber + "</td></tr>";
info+="<tr><td >Version:" + p.Version + "</td></tr>";
info+="<tr><td >Status:" + p.Status+ "</td></tr>";
}
info+="</table>";
return info;
}
//获取Ram信息
function raminfo(){
var system=new Enumerator (service.ExecQuery("SELECT * FROM Win32_ComputerSystem")).item();
var physicMenCap=Math.ceil(system.TotalPhysicalMemory/1024/1024); //内存信息
var memory = ne
- 1
- 2
前往页