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