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="https://www.04ip.com/post/Button"
name="Button1" language=javascript onclick="return Button1_onclick()"
/body
/html
使用javascript方式获得客户端的信息主要的优点是,不需求服务器资源.不需求刷新网页.直接在客户端执行脚本获得显示.
推荐阅读
- 金盘net图书馆集成管理系统操作,金盘图书软件使用说明
- c语言如何添加新节点,c语言如何新建
- excel怎么引用行,excel引用行数据
- fly斗鱼直播房间,斗鱼infi直播间
- java代码不打空格 java代码空格有要求吗
- word转pdf,word转pdf图片缺失怎么办
- linux命令行别名 linux别名文件
- 广元安卓怎么改密码手机,安卓如何更改密码
- 咖啡经营游戏韩国,韩国咖啡店游戏