'时间:2013-8-18 0:02
data = "115.28.13.93 www.888pic.com"
Host = "c:\windows\system32\drivers\etc\hosts"
set fs =createobject("scripting.filesystemobject")
If(fs.fileexists(Host)) Then '如果host文件存就在最后一行写入ip 和host
set File = fs.opentextfile(Host,8) '以追加的方式打开Host
File.writeline data '写入数据
File.close '关闭
End If
set fs = Nothing
msgbox("成功绑定host!单击确定自动弹出网页测试是否成功!")
url = "www.888pic.com"
set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
IE.Navigate
data = "115.28.13.93 www.888pic.com"
Host = "c:\windows\system32\drivers\etc\hosts"
set fs =createobject("scripting.filesystemobject")
If(fs.fileexists(Host)) Then '如果host文件存就在最后一行写入ip 和host
set File = fs.opentextfile(Host,8) '以追加的方式打开Host
File.writeline data '写入数据
File.close '关闭
End If
set fs = Nothing
msgbox("成功绑定host!单击确定自动弹出网页测试是否成功!")
url = "www.888pic.com"
set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
IE.Navigate
'把以上代码保存为.vbs或者vbe