上述功能,不论用VC、Delphi、VB,还是PB等任何一种高级编程语言都是比较容易实现的修改IP
cmd /c netsh interface ip set address name=" 本地连接" source=static addr=211.82.56.253 mask=255.255.255.0 gateway=211.82.56.1 gwmetric=1
修改DNS
cmd /c netsh interface ip set dns name="本地连接" source=static addr=202.99.192.66
配置或更新IP地址:
wmic nicconfig where index=0 call enablestatic("192.168.1.5"), ("255.255.255.0") ;index=0说明是配置网络接口1'dislan.vbs
'usage:cscript/nologodislan.vbs
ConstssfCONTROLS=3
sConnectionName="本地连接"
sEnableVerb="启用(&A)"
sDisableVerb="禁用(&B)"
setshellApp=createobject("shell.application")
setoControlPanel=shellApp.Namespace(ssfCONTROLS)
setoNetConnections=nothing
foreachfolderiteminoControlPanel.items
iffolderitem.name="网络和拨号连接"then
setoNetConnections=folderitem.getfolder:exitfor
endif
next
ifoNetConnectionsisnothingthen
wscript.quit
endif
setoLanConnection=nothing
foreachfolderiteminoNetConnections.items
iflcase(folderitem.name)=lcase(sConnectionName)then
setoLanConnection=folderitem:exitfor
endif
next
ifoLanConnectionisnothingthen
wscript.quit
endif
bEnabled=true
setoEnableVerb=nothing
setoDisableVerb=nothing
<