[JS] 創建 ActiveX 獲取 Mac Address 位址
此代碼僅限 IE 使用,不知道到有沒有更好的方法?
Get Mac Address by JavaScript and ActiveX
Get Mac Address by JavaScript and ActiveX
var locator =new ActiveXObject ("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled =True");
var e =new Enumerator (properties);
{
var p = e.item();
var mac = p.MACAddress;
alert(mac)
}
留言
張貼留言