当前位置:编程学习 > VB >>

用VBScript修改本机IP地址

[vb]  
  
[vb]  
Dim IP,Name  
Ip=Inputbox ("请输入IP")  
strComputer = "."  
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")  
Set colNetAdapters = objWMIService.ExecQuery _  
    ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")  
strIPAddress = Array(IP)  
strSubnetMask = Array("255.255.255.224")  
For Each objNetAdapter in colNetAdapters  
    errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)  
Next  
 
补充:Web开发 , 其他 ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,