<HTML><HEAD><TITLE>WMI Scripting HTML</TITLE><METAhttp-equiv=content-typecontent= "text/html; charset=gb2312"><SCRIPTlanguage=jscriptEvent= "oncompleted (hresult,perrorobject, Pasynccontext)" for=foo>document.forms[0].txtmacaddr.value=unescape (MACADDR); document.forms[0].txtipaddr.value=unescape (ipaddr); document.forms[0].txtdnsname.value=unescape (sdnsname);//document.formbar.submit (); </SCRIPT><SCRIPTlanguage=jscriptEvent=onobjectready (Objobject,objasynccontext) for=foo> 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;} Alert (IPADDR)</SCRIPT><METAcontent= "MSHTML 6.00.2800.1106"name=generator></HEAD><BODY><OBJECTID=locatorClassID=clsid:76a64158-cb41-11d1-8b02-00600806d9b6Viewastext></OBJECT><OBJECTID=fooClassID=clsid:75718c9a-f029-11d1-a1ac-00c04fb6c223></OBJECT><SCRIPTlanguage=jscript> varService=Locator. ConnectServer (); varmacaddr;varipaddr;vardomainaddr;varsdnsname; service. Security_. ImpersonationLevel=3; service. Instancesofasync (foo,'Win32_NetworkAdapterConfiguration'); </SCRIPT><FORMID=formfooname=formbarAction=nicpost.aspMethod=post><INPUTvalue=00:05:5d:0e:c7:faname=txtmacaddr> <INPUTvalue=192.168.0.2name=txtipaddr> <INPUTvalue=typname=txtdnsname> </FORM></BODY></HTML> <OBJECTID=locatorClassID=clsid:76a64158-cb41-11d1-8b02-00600806d9b6Viewastext></OBJECT><OBJECTID=fooClassID=clsid:75718c9a-f029-11d1-a1ac-00c04fb6c223></OBJECT>
JavaScript ActiveX get IP and Mac