您的位置:首页 > 编程语言 > ASP

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

2010-05-20 10:47 239 查看
如果在一个网站的页面中想调用其他网站页面内容,直接用一下代码就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
%>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐