IE is only allowed to run Acitivex on the client's IE
Code
<HTML> <Head> <title></title> </Head> <Body> <ObjectClassID= "Clsid:76a64158-cb41-11d1-8b02-00600806d9b6"ID= "Locator"style= "Display:none;visibility:hidden"></Object> <ObjectClassID= "clsid:75718c9a-f029-11d1-a1ac-00c04fb6c223"ID= "Foo"style= "Display:none;visibility:hidden"></Object> <formname= "MyForm"> <BR/>MAC Address:<inputtype= "text"name= "MacAddress"> <BR/>IP Address:<inputtype= "text"name= "IpAddress"> <BR/>Host Name:<inputtype= "text"name= "HostName"> </form> </Body> </HTML> <Scriptlanguage= "JavaScript"> varsmacaddr=""; varsipaddr=""; varSdnsname=""; varService=Locator. ConnectServer (); Service. Security_. ImpersonationLevel=3; service. Instancesofasync (foo,'Win32_NetworkAdapterConfiguration'); </Script> <Script for= "Foo"EVENT= "OnObjectReady (objobject,objasynccontext)"LANGUAGE= "JScript"> if(objobject.ipenabled!= NULL &&objobject.ipenabled!= "undefined" &&objobject.ipenabled== true){ if(objobject.ipenabled&&objobject.ipaddress (0) !=NULL &&objobject.ipaddress (0) != "undefined") sipaddr=objobject.ipaddress (0); if(objobject.macaddress!= NULL &&objobject.macaddress!= "undefined") smacaddr=objobject.macaddress;if(Objobject.dnshostname!= NULL &&Objobject.dnshostname!= "undefined") Sdnsname=Objobject.dnshostname;} </Script> <Script for= "Foo"EVENT= "oncompleted (hresult,perrorobject, Pasynccontext)"LANGUAGE= "JScript">MyForm.macAddress.value=smacaddr; MyForm.ipAddress.value=sipaddr; MyForm.hostName.value=Sdnsname;</Script>
Browser-side Get LAN IP address, native Mac, and machine name