例子,获取客户端IP地址与MAC地址。
复制代码 代码示例:
WMI Scripting HTML--获取客户端IP地址与MAC地址
document.forms[0].txtMACAddr.value = unescape(MACAddr);
document.forms[0].txtIPAddr.value = unescape(IPAddr);
document.forms[0].txtDNSName.value = unescape(sDNSName);
//document.formbar.submit();
// jquery中文网
if (objObject.IPEnabled != null && objObject.IPEnabled != "undefined"
&& objObject.IPEnabled == true) {
if (objObject.MACAddress != null && objObject.MACAddress != "undefined")
MACAddr = objObject.MACAddress;
if (objObject.IPEnabled && objObject.IPAddress(0) != null
&& objObject.IPAddress(0) != "undefined")
IPAddr = objObject.IPAddress(0);
if (objObject.DNSHostName != null
&& objObject.DNSHostName != "undefined")
sDNSName = objObject.DNSHostName;
}
var service = locator.ConnectServer();
var MACAddr;
var IPAddr;
var DomainAddr;
var sDNSName;
service.Security_.ImpersonationLevel = 3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
value="" name="txtMACAddr">