在访问ASP网站页面时调用另一个网站页面内容
如果在一个网站的页面中想调用其他网站页面内容,直接用一下代码就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
%>
相关文档:
最近帮老师做一个国际会议的网站,用asp做的,虽然很简单,但配置的过程也有些东西需要注意的,否则检查不出来,很浪费时间,注意事项罗列如下:
1. 网站的权限设定,默认情况下,不能访问“父文件夹”,这时候需要在iis的asp选项中设置,“打开功能”->“启用父路径”
2. 数据库有时候 ......
在 计算机管理->InterNet信息服务 -> 默认网站 -> 右键 -> 新建 -> 虚拟目录 (别名:相当于文件夹)-> 选择源文件的路径,新建完成
右键点击刚刚新建的虚拟目录:
虚拟目录:勾选 读取。执行权限:纯脚本。后来又遇到了这样的错误: 在
应用程序级别之外使用注册为 allowDefinition='MachineToAppl ......
在编写ASP程序的时候,通常都会用到<!--#include virtual/file="path/filename"-->把一段相对独立的文件代码嵌套到当前页面中来。
使用"file"的时候,等号后面使用的是相对路径。使用"virtual"的时候,等号后面使用的是绝对路径。很多人都不知道virtual这个包含绝对路径。 ......