我有一需求,请教怎么实现,请老鸟给个代码

tiky_6228769 2006-04-25 09:27:49
“下载”点了以后,把数据库的东西输出到浏览器给他下载成TXT文本文件(不生成真实的TXT文件)
请教这个怎么实现啊?
...全文
124 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
www_7di_net 2006-04-25
  • 打赏
  • 举报
回复
Response.Buffer=true
Response.Clear
isql="select * from table where ..."
iRe.open iSql,conn,1,1
if not iRe.eof then

Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment;filename=aa.txt"
Response.BinaryWrite iRe("content")

end if
tiky_6228769 2006-04-25
  • 打赏
  • 举报
回复
对对,就是这样,谢谢
sxsgssgs 2006-04-25
  • 打赏
  • 举报
回复
Response.Buffer=true
Response.Clear
isql="select * from table where ..."
iRe.open iSql,conn,1,1
if not iRe.eof then

Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment;filename=aa.txt"
Response.BinaryWrite iRe("content")

end if
tiky_6228769 2006-04-25
  • 打赏
  • 举报
回复
楼上的,这样是直接显示在页面上,并没弹出提示下载框
  • 打赏
  • 举报
回复
set rs=conn.execute("select xxx from tab")

while not rs.eof
str=str&rs(0)
rs.movenext
wend

response.contentType="text/plain"
response.write str
taito 2006-04-25
  • 打赏
  • 举报
回复
不生成真实的TXT文件?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧