金瓶梅 龚玥菲,淘白米,董永存
msg="请输入你要查询的ip或域名:"
ip=inputbox(msg,"ip地理位置查询小偷")
if ip = "" then ip = "127.0.0.1"
url = "http://www.ip.cn/?q="& ip &""
body = gethttppage(url)
set re = new regexp
re.pattern = "(查询结果为:.+)"
set matches = re.execute(body)
if matches.count>0 then body = matches(0)
're.pattern = "\[[\s\s]*\]"
'body = re.replace(body, "")
'wscript.echo ip & body
set oxmlhttprequest=nothing
set objexplorer = wscript.createobject("internetexplorer.application")
objexplorer.navigate "about:blank"
objexplorer.toolbar = 0
objexplorer.statusbar = 0
objexplorer.visible = 1
objexplorer.height=300
objexplorer.width=400
objexplorer.left=400
objexplorer.resizable=0
objexplorer.document.body.innerhtml =ip & body
'objexplorer.document.parentwindow.clipboarddata.setdata "text", ip & body
set objexplorer=nothing
'函数区
function gethttppage(path)
t = getbody(path)
gethttppage = bytestobstr(t, "utf-8")
end function
function getbody(url)
on error resume next
set retrieval = createobject("microsoft.xmlhttp")
with retrieval
.open "get", url, false, "", ""
.send
getbody = .responsebody
end with
set retrieval = nothing
end function
function bytestobstr(body, cset)
dim objstream
set objstream = createobject("adodb.stream")
objstream.type = 1
objstream.mode = 3
objstream.open
objstream.write body
objstream.position = 0
objstream.type = 2
objstream.charset = cset
bytestobstr = objstream.readtext
objstream.close
set objstream = nothing
end function
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
-
用vbs实现文本循环读取
因为测试中需要读取一批url数据进行浏览,其实使用qtp本身的table能实现多种读取方式,但是因为需要tabel是使用excel保存的,在没有...
[阅读全文]
-
-
-
-
-
-
-
网友评论