日期:2014-05-16 浏览次数:20890 次
Function GETHttpPage(GetUrl)
Dim xmlHttp
Dim RetStr
Set xmlHttp =server.CreateObject("Msxml2.XMLHTTP")
xmlHttp.Open "GET",GetUrl, False
xmlHttp.Send
If Err.Number <> 0 Then
Set xmlHttp=Nothing
GETHttpPage = "ERROR"
Exit Function
End If
GETHttpPage=bytesToBSTR(xmlHttp.responseBody,"GB2312")
Set xmlHttp= nothing
End Function
Function BytesToBstr(strBody,CodeBase)
dim obj
set obj=Server.CreateObject("Adodb.Stream")
obj.Type=1
obj.Mode=3
obj.Open
obj.Write strBody
obj.Position=0
obj.Type=2
obj.Charset=CodeBase
BytesToBstr=obj.ReadText
obj.Close
set obj=nothing
End Function
ip=request.ServerVariables("remote_addr")
response.Write "
------解决方案--------------------
"&GETHttpPage("http://www.ip.cn/getip.php?action=queryip&ip_url="&ip&"&from=web")&"
------解决方案--------------------
"