📅  最后修改于: 2022-03-11 15:01:21.940000             🧑  作者: Mango
function showMacAddress() {
var obj = new ActiveXObject("WbemScripting.SWbemLocator");
var s = obj.ConnectServer(".");
var properties = s.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration");
var e = new Enumerator(properties);
var output;
output = '';
output = output + 'Caption MACAddress ';
while (!e.atEnd()) {
e.moveNext();
var p = e.item();
if (!p) continue;
output = output + '';
output = output + '' + p.Caption; +' ';
output = output + '' + p.MACAddress + ' ';
output = output + ' ';
}
output = output + '
';
document.getElementById("box").innerHTML = output;
}
showMacAddress();