仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2558|回复: 18
打印 上一主题 下一主题

[学习教程] ASP网页设计FSO 读出TXT文件

[复制链接]
愤怒的大鸟 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-2-16 00:25:13 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
缺点:正版成本价格贵(盗版就不说了)、不够安全,大多数服务器用windows系统,没有linux安全fso   <!--#include file="dbconn.asp"-->
<%
function ReadFile(filename)
on error resume next
err.clear
'ASP的一种校错办法
Const ForReading = 2
Const Create = false
Dim FSO
DIM TS
DIM filepath
DIM thefile
Dim content

'---------------操作地址

Set FSO=server.createobject("scripting.filesystemobject")
filepath=server.MapPath("temp") ./纪录本寄存的文件夹

if err.number<>0 then
response.Write "目次不存在"
response.End
end if

'filename="test.txt" ---------test.txt为你从数据库里读出的文件名
thefile=filepath&"/"&filename
Set TS = FSO.OpenTextFile(thefile,1)

do until Ts.AtEndOfStream
Response.Write (""&TS.ReadLine&"")
response.write("<br>")
loop

Set TS = Nothing
Set FSO = Nothing
end function
%>

<%
dim id
dim filename
id=6
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from yuan where id="&id
rs.open sql,cn,1,1
filename=rs("fileload")
%>

<% readfile(filename) %>


</p>  对于中小型web应用来说,php有很强的竞争力,linux+apache+mysql+php(lamp)的组合几乎可以胜任绝大多数网站的解决方案,对于大型应用来讲,对于系统架构要求更高,需要有成熟的框架支持,jsp的struts是个不错的框架,国内介绍它的资料也非常多,应用逐渐广泛起来。asp就不用说了,
愤怒的大鸟 该用户已被删除
沙发
 楼主| 发表于 2015-4-4 21:42:21 | 显示全部楼层
没有坚实的理论做基础,那么我们连踏入社会第一步的资本都没有,特别对于计算机专业的学生学好专业知识是置关重要的。在这里我侧重讲一下如何学习ASP,从平时的学习过程中。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-10 22:07

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表