当前位置: 移动技术网 > IT编程>脚本编程>VBScript > vbs版IP地理位置查询小偷

vbs版IP地理位置查询小偷

2017年12月12日  | 移动技术网IT编程  | 我要评论

金瓶梅 龚玥菲,淘白米,董永存

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

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网