JS获取软盘信息
Admin | 2015-9-10 9:18:30 | 被阅次数 | 4003
下面的功能代码,指的是通过JS获取软盘的信息。
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>");