我正在使用C#.net,asp.net和.net framework 2。 如何使用javascript或asp.net获取客户端系统硬盘的序列号?
提前致谢
答案 0 :(得分:1)
获取Asif Ali的客户机信息
var strComputer = ".";
var SWBemlocator = new ActiveXObject("WbemScripting.SWbemLocator");
var objWMIService = SWBemlocator.ConnectServer(strComputer, "/root/CIMV2");
var strProcess;
var colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem");
var e = new Enumerator(colItems);
for(; ! e.atEnd(); e.moveNext())
{
strProcess += "itema "+ e.item().Name + "<br>\n";
}
colItems =
objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration
where IPEnabled=true");
e = new Enumerator(colItems);
for(; ! e.atEnd(); e.moveNext())
{
strProcess += "itemb "+ e.item().Name + "<br>\n";
}
document.getElementById('sys_info').innerHTML = strProcess;