在访问ASP网站页面时调用另一个网站页面内容

来源:互联网 发布:淘宝投诉卖家多久受理 编辑:程序博客网 时间:2024/05/17 08:19

如果在一个网站的页面中想调用其他网站页面内容,直接用一下代码就ok,http://www.wanyusoft.com/index.asp 这个路径就是所要调用的页面路径。

<%
response.write(getHTTPPage("http://www.wanyusoft.com/index.asp"))
function getHTTPPage(url)
dim http
set http=createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function
Function bytes2BSTR(vIn)
dim wanyusoft_strReturn
dim i,ThisCharCode,NextCharCode
wanyusoft_strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
wanyusoft_strReturn = wanyusoft_strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
wanyusoft_strReturn = wanyusoft_strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = wanyusoft_strReturn
End Function
%>

原创粉丝点击