JS获取计算机mac地址以及IP的实现方法 复制代码 代码如下: //这两个是系统里的ActiveX插件 用来获取ip以及物理地址 <BR> if(objObject.IPEnabled != null && objObject.IPEnabled != "undefined " && objObject.IPEnabled == true) <BR> { <BR> if(objObject.MACAddress != null && objObject.MACAddress != "undefined ") <BR> MACAddr = objObject.MACAddress; <BR> if(objObject.IPEnabled && objObject.IPAddress(0) != null && objObject.IPAddress(0) != "undefined ") <BR> IPAddr = objObject.IPAddress(0); <BR> if(objObject.DNSHostName != null && objObject.DNSHostName != "undefined ") <BR> sDNSName = objObject.DNSHostName; <br><br> } <BR> <BR> var service = locator.ConnectServer(); <BR> var MACAddr ; <BR> var IPAddr ; <BR> var DomainAddr; <BR> var sDNSName; <BR> service.Security_.ImpersonationLevel=3; <BR> service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration '); <br><br> <BR> alert("物理地址"+MACAddr+"IP地址"+IPAddr+"主机名"+sDNSName))<BR> "