在访问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
%>
<%
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
%>
相关文章推荐
- Asp.Net : 捕捉和记录网站中出现的所有未处理错误,抛出详细的页面来源和访问ip,调用的接口方法及异常实例(记事本日志,系统日志及数据库日志)
- 用asp.net实现远程获取其他网站页面指定内容
- ASP.Net访问母版页(MasterPage)控件、属性、方法及母版页中调用内容页,获取用户自定义控件里面的子控件的方法
- ASP.net C#获取其他网站的页面内容
- ASP.Net访问母版页(MasterPage)控件、属性、方法及母版页中调用内容页的方法
- 在一个网站的asp文件下,重定向另一个网站的jsp网页,如何实现在本网站中隐藏调用网站的域名?
- ASP.Net访问母版页(MasterPage)控件、属性、方法及母版页中调用内容页,获取用户自定义控件里面的子控件的方法
- [转]用asp.net实现远程获取其他网站页面指定内容
- ASP.NET母版页中调用内容页的方法和web用户控件调用.aspx页面里的方法
- 用asp.net实现远程获取其他网站页面指定内容
- 访问asp网站时,页面上显示请求的资源在使用中
- ASP.NET动态网站开发培训-37.互动论坛制作(五、制作详细内容页面)
- js 如何调用另一个页面id 内容
- IIS6.0 ,网站上的html可以正常访问,asp页面提示找不到页面404 错误
- php抓取网站内容,获取通达OA官网最新用户,判断页面是否能访问,php正则
- asp.net网站项目调用page,或者ashx页面不能用反射
- 用asp.net实现远程获取其他网站页面指定内容
- 在一个asp.net页面调用另一个asp.net页面的类
- ASP.Net访问母版页(MasterPage)控件、属性、方法及母版页中调用内容页的方法
- ASP.Net访问母版页(MasterPage)控件、属性、方法及母版页中调用内容页,获取用户自定义控件里面的子控件的方法