本地连接DNS修改器
程序代码
Dim mc,mo,cnc,cuc,title,mymac,mydns,mydnsip cnc = "网通" : cncdns="202.96.64.68" cuc = "联通" : cucdns="211.93.80.129" title = "本地连接DNS修改器" Set mymac=GetObject("Winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration") For Each mydns In mymac If mydns.IPEnabled=True Then mydnsip = mydns.DNSServerSearchOrder For i = 0 to UBound(mydnsip) strObj = strObj & mydnsip(i) next If strobj = cucdns Then newstr = "当前连接的DNS:"&Chr(10)&Chr(10)&cuc&":"&strobj&Chr(10)&Chr(10)&"是否修改为:"&Chr(10)&Chr(10)&cnc&":"&cncdns msg=MsgBox(newstr,1+32,title) If msg = 1 Then mydns.SetDNSServerSearchOrder Array(cncdns) MsgBox "OK!修改成功!",48,title End If ElseIf strobj = cncdns Then newstr = "当前连接的DNS:"&Chr(10)&Chr(10)&cnc&":"&strobj&Chr(10)&Chr(10)&"是否修改为:"&Chr(10)&Chr(10)&cuc&":"&cucdns msg=MsgBox(newstr,1+32,title) If msg = 1 Then mydns.SetDNSServerSearchOrder Array(cucdns) MsgBox "OK!修改成功!",48,title End If End If Exit For End If Next (转自http://www.rootkit.net.cn/article.asp?id=35) Change Gateway\DNS for vbs
|


foxhack
博客统计信息
热门文章
最新评论
友情链接