请教一个问题,执行如下ip.vbs脚本将本机出口ip地址写入ip.txt文件,在电脑安装IE、火狐浏览器下是正常工作的,但安装了360浏览器之后,在执行ip.vbs脚本时,会自动打开360浏览器访问:http://iframe.ip138.com/ic.asp。
不理解的是:ie.Visible=False 对360浏览器无效吗?怎么做才能禁止打开360浏览器呢?非常感谢!
ip.vbs代码:- on error resume next
- set ie=CreateObject("internetexplorer.application")
- ie.navigate("http://www.ip138.com/ip2city.asp")
- ie.Visible=False
- While ie.busy Or ie.readystate <> 4
- WEnd
- Set regEx = New RegExp
- regEx.Pattern ="\d.*\d"
- Set Matches = regEx.Execute(ie.document.body.innerhtml)
- ie.quit
- For Each Match in Matches
- RetStr=Match.Value
- Next
- Fn="ip.txt"
- Set FSO = CreateObject("scripting.filesystemobject")
- Set tfile=FSO.opentextfile(FN,8,-2)
- tfile.WriteLine "ip:" & RetStr
- tfile.Close
- set tfile=nothing
- Set FSO = Nothing
复制代码
|