asp 读取 另外一个带参数的asp文件(服务器不支持!放弃吧!骚年!)
(服务器不支持!放弃吧!骚年!)
主要作用是为了分离数据库,灵感是这样的:收到json影响,把asp里的数据,用一个页面输出,然后用另外一个页面读取,这样就不用有数据库位置的烦恼了
代码 网上有很多,我贴上,作为记录
<%
Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function getHTTPPage(Path)
t = GetBody("http://localhost/"&Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function
content = getHTTPPage("userComm.asp?do=k")
response.Write(content)
%>
最新文章
- 《Redis入门指南(第二版)》读书思考总结之Redis五大数据类型
- VMware创建Linux虚拟机并安装CentOS(三)
- MySQL GROUP BY用法
- 框架 Onboard-引导页样式制作库
- Angular $scope和$rootScope事件机制之$emit、$broadcast和$on
- ubuntu软件推荐
- 给大一的学弟学妹们培训java web的后台开发讨论班计划
- Django基础,Day10 - template 模板引擎与路径设置
- 【网络编程】——linux socket demo
- yii 中引入js 和css 的方式
- 0c-41-ARC使用特点及注意事项
- OC文件操作(2)
- JS 昵称,手机号,邮箱判断
- 解析SS、SP、BP寄存器
- 1081. Rational Sum (20) -最大公约数
- TrueType字体的后缀名解释
- Codeforces Gym 101190M Mole Tunnels - 费用流
- Docker学习笔记-磁盘挂载运行.netcore
- k短路模板(洛谷P2483 [SDOI2010]魔法猪学院)(k短路,最短路,左偏树,priority_queue)
- kafka为什么这么优秀!