📜  JavaScript 代码示例中的 MAC 地址

📅  最后修改于: 2022-03-11 15:01:21.940000             🧑  作者: Mango

代码示例1
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 + '';
    while (!e.atEnd()) {
        e.moveNext();
        var p = e.item();
        if (!p) continue;
        output = output + '';
        output = output + '';
        output = output + '';
        output = output + '';
    }
    output = output + '
CaptionMACAddress
' + p.Caption; +'' + p.MACAddress + '
'; document.getElementById("box").innerHTML = output; } showMacAddress();