Ⅰ 網頁中的js可以獲取電腦中的哪些信息
//CPU信息
varlocator=newActiveXObject("WbemScripting.SWbemLocator");
varservice=locator.ConnectServer(".");
varproperties=service.ExecQuery("SELECT*FROMWin32_Processor");
vare=newEnumerator(properties);
document.write("<tableborder=1>");
for(;!e.atEnd();e.moveNext())
{
varp=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>");
//主板信息
varlocator=newActiveXObject("WbemScripting.SWbemLocator");
varservice=locator.ConnectServer(".");
varproperties=service.ExecQuery("SELECT*FROMWin32_BaseBoard");
vare=newEnumerator(properties);
document.write("<tableborder=1>");
for(;!e.atEnd();e.moveNext())
{
varp=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.Proct+"</td>");
document.write("<td>"+p.SerialNumber+"</td>");
document.write("<td>"+p.Version+"</td>");
document.write("</tr>");
}
document.write("</table>");
//網路信息
varlocator=newActiveXObject("WbemScripting.SWbemLocator");
varservice=locator.ConnectServer(".");
varproperties=service.ExecQuery("SELECT*FROMwin32_networkadapterconfiguration");
vare=newEnumerator(properties);
document.write("<tableborder=1>");
for(;!e.atEnd();e.moveNext())
{
varp=e.item();
if(p.IPAddress==null){
continue;
}
document.write("<tr>");
document.write("<td>"+p.Caption+"</td>");
document.write("<td>"+p.IPAddress(0)+"</td>");
document.write("<td>"+p.MACAddress+"</td>");
document.write("</tr>");
}
document.write("</table>");