< 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 Cmd.txt macaddr. Value = Unescape (macaddr );
Document. Forms [ 0 Cmd.txt ipaddr. Value = Unescape (ipaddr );
Document. Forms [ 0 Cmd.txt dnsname. 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 " )
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 >
< Meta Content = "Mshtml 6.00.2800.1106" Name = Generator > </ Head >
< Body >
< Object ID = Locator Classid = CLSID: 76a64158-cb41-11d1-8b02-00600806d9b6 Viewastext > </ Object >
< 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 = "Index. Do" Method = "Post" >
< Input Value = "" Name = "Txtmacaddr" >
< Input Value = "" Name = "Txtipaddr" >
< Input Value = "" Name = "Txtdnsname" >
</ Form >
</ Body >
</ Html >