<!DOCTYPE HTML><HTML><Head><title>JS get native MAC address, IP address, computer name</title><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><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> <Scriptlanguage= "JScript"Event= "oncompleted (hresult,perrorobject, Pasynccontext)" for= "Foo">document.forms[0].txtmacaddr.value=unescape (MACADDR); Document.all.txtIPAddr.value=unescape (IPADDR); document.forms[0].txtdnsname.value=unescape (sdnsname); //document.formbar.submit ();</Script> <Scriptlanguage= "JScript"Event= "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; }} </Script> <formID= "Formfoo"name= "Formbar"Action="#"Method= "POST"><inputvalue= "00:05:5d:0e:c7:fa"name= "Txtmacaddr"><inputvalue= "10.241.91.51"name= "Txtipaddr"><inputvalue= "Typ"name= "Txtdnsname"></form></Body></HTML>
JS get native MAC address, IP address, computer name