msg="请输入你要查询的IP或域名:"
IP=Inputbox(msg,"IP地理位置查询小偷")
IfIP=""ThenIP="127.0.0.1"
url="http://www.ip.cn/?q="&IP&""
Body=getHTTPPage(url)
SetRe=NewRegExp
Re.Pattern="(查询结果为:.+)"
SetMatches=Re.Execute(Body)
IfMatches.Count>0ThenBody=Matches(0)
'Re.Pattern="[[sS]*]"
'Body=Re.Replace(Body,"")
'wscript.echoIP&Body
SetoXMLHttpRequest=Nothing
SetobjExplorer=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
SetobjExplorer=nothing
'函数区
FunctiongetHTTPPage(Path)
t=GetBody(Path)
getHTTPPage=BytesToBstr(t,"UTF-8")
EndFunction
FunctionGetBody(url)
OnErrorResumeNext
SetRetrieval=CreateObject("Microsoft.XMLHTTP")
WithRetrieval
.Open"Get",url,False,"",""
.Send
GetBody=.ResponseBody
EndWith
SetRetrieval=Nothing
EndFunction
FunctionBytesToBstr(Body,Cset)
Dimobjstream
Setobjstream=CreateObject("adodb.stream")
objstream.Type=1
objstream.Mode=3
objstream.Open
objstream.WriteBody
objstream.Position=0
objstream.Type=2
objstream.Charset=Cset
BytesToBstr=objstream.ReadText
objstream.Close
Setobjstream=Nothing
EndFunction