Vbs IP address location query thief

Source: Internet
Author: User

MSG = "Enter the IP address or domain name you want to query :"
IP = inputbox (MSG, "ip location query thief ")

If IP = "" Then IP = "127.0.0.1"
Url = "http://www.ip.cn /? Q = "& IP &""
Body = gethttppage (URL)

Set Re = new Regexp
Re. pattern = "(Query Result:. + )"
Set matches = Re. Execute (Body)
If matches. Count> 0 then body = matches (0)
'Re. pattern = "\ [\ 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
Object explorer. Height = 300
Object explorer. width = 400
Objexplorer. Left = 400
Objexplorer. resizable = 0
Objexplorer. Document. Body. innerhtml = IP & Body

'Objjavaser.doc ument. parentwindow. clipboardData. setdata "text", IP & Body

Set objexplorer = nothing

'Function Area

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
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.