js 獲取mac地址code
function MacInfo(){ 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) } }