XMLHTTP ---post 高手进

来源:百度知道 编辑:UC知道 时间:2024/06/07 19:53:39
<%
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

xml.Open "post", "http://www.ip138.com/", False
' Pull the data from the web page
xml.Send
Set xml = Nothing
%>

不如我要查的IP是..116.11.234.198
怎么做???

<%
'防止超时
Server.ScriptTimeOut =9999
'得到http://域名
url="http:zjc.ncu.cn/fws"
str="发送内容"

Body=getHTTPPage(url,str )
'body就是取回的内容

'xmlhttp获得web内容的函数
Function getHTTPPage(url,str)
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "post",url,false
Http.send(str)
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
end Function

'获得内容编码,然后解码函数
Function bytes2BSTR(vIn)
dim strReturn
dim i1,ThisCharCode,NextCharCode
strReturn = ""
For i1 = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i1,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i1+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCo