1, through ActiveX controls
View Plaincopy to clipboardprint?<html><head><title>wmi scripting html</title> < META http-equiv=content-type content= "text/html; charset=gb2312 "> <script language=jscript event=" oncompleted (Hresult,perrorobject, PAsyncContext) "for= foo> //Document.forms[0].txtmacaddr.value=unescape (MACADDR); Document.forms[0].txtipaddr.value=unescape (IPADDR); Alert (unescape (IPADDR)); //Document.forms[0].txtdnsname.value=unescape (Sdnsname); //document.formbar.submit (); </SCRIPT> <script language=jscript event=onobjectready (objobject,objasynccontext) for= foo> if (objobject.ipenabled!= null && objobject.ipenabled!= "undefined" && objobject.i penabled = = true) { //if (objobject.macaddress!= null && objobject.macaddress!= "Undefined") &NBSP;//MACADDR = objobject.macaddress; &NBSp;if (objobject.ipenabled && objobject.ipaddress (0)!= null && objobject.ipaddress (0)!= "undefined") & nbsp &NBSP;IPADDR = objobject.ipaddress (0); //if (objobject.dnshostname!= null && objobject.dnshostname!= "undefined") &NB Sp;//sdnsname = Objobject.dnshostname; &NBSP} </SCRIPT> <meta content= "MSHTML 6.00.2800.1106" name=generator> </HEAD> <body><object Id=foo classid=clsid:75718c9a-f029-11d1-a1ac-00c04fb6c223></ object> <script language=jscript> var service = Locator. ConnectServer (); VAR macaddr; VAR ipaddr; VAR domainaddr; VAR sdnsname; Service. Security_. impersonationlevel=3; Service. Instancesofasync (foo, ' Win32_NetworkAdapterConfiguration '); </SCRIPT> <form Id=formfoo name=formbar action=nicpost.asp method=post> <input value=00:05:5d:0e:c7:fa name=txtmacaddr> <input value=192.168.0.2 name=txtipaddr> <input Value=typ name=txtdnsname> </FORM> </BODY> </HTML> <html><head><title >WMI scripting Html</title><meta http-equiv=content-type content= "text/html; charset=gb2312 "><script language=jscript event=" oncompleted (Hresult,perrorobject, PAsyncContext) "For=foo" >//Document.forms[0].txtmacaddr.value=unescape (MACADDR); Document.forms[0].txtipaddr.value=unescape (IPADDR); Alert (unescape (IPADDR));//Document.forms[0].txtdnsname.value=unescape (Sdnsname); Document.formbar.submit (); </script><script language=jscript Event=onobjectready (objobject,objasynccontext) for=foo> if (objobject.ipenabled!= null && objobject.ipenabled!= "undefined" && objobject.ipenabled = = true) {
//if (objobject.macaddress!= null && objobject.macaddress!= "undefined") &NBSP;//MACADDR = objobject.macaddress; if (objobject.ipenabled && objobject.ipaddress (0)!= null && objobject.ipaddress (0)!= " Undefined ") &NBSP;IPADDR = objobject.ipaddress (0); //if (objobject.dnshostname!= null && objobject.dnshostname!= "undefined") // Sdnsname = Objobject.dnshostname; &NBSP} </script><meta content= "MSHTML 6.00.2800.1106" name=generator>
<input value=00:05:5d:0e:c7:fa name=txtmacaddr> <input value=192.168.0.2 name=txtIPAddr> <INPUT value= Typ name=txtdnsname> </FORM></BODY></HTML>
2, by calling the DOS command
View Plaincopy to clipboardprint?