加入收藏 | 设为首页 | 会员中心 | 我要投稿 大同站长网 (https://www.0352zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

如何一行行地读取文件?

发布时间:2016-11-29 17:25:41 所属栏目:MySql教程 来源:站长网
导读:dim input(30) ' 定义一个数组,大小可随时更改.这里为了显示方便. file_path=Server.Mappath("index.html") Set fs=Server.CreateObject("Scripting.FileSystemObject") Set file_open=fs.OpenTextFile(file_path) n=0 Do While Not file_open.AtEndOfStre

dim input(30)

' 定义一个数组,大小可随时更改.这里为了显示方便.

file_path=Server.Mappath("index.html")

Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set file_open=fs.OpenTextFile(file_path)

n=0

Do While Not file_open.AtEndOfStream

n=n+1

fileline=file_open.readline

input(i)=fileline

' 将文件内容读入input数组.

Loop

file_open.close

Set fs=Nothing

nbsp;

另外,对于二进制数据,我们也可以用Read()来读取,如:

file_open.Read(200)

就是读取file_open中的200个数据。

(编辑:大同站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读