如何使用javascript获取客户端MAC地址?

时间:2013-05-15 04:10:18

标签: javascript

预先感谢那些通过javascript向我提供有关如何查找物理地址的重要提示的人。

1 个答案:

答案 0 :(得分:3)

希望这有帮助!

function networkInfo(){

var wmi = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = wmi.ConnectServer(".");


e = new Enumerator(service.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"));


for(; !e.atEnd(); e.moveNext()) {
    var s = e.item();
    var macAddress = unescape(s.MACAddress);

}

return macAddress;
}