如何一行行地读取文件?

(编辑:jimmy 日期: 2025/3/16 浏览:2)

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

 

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

file_open.Read(200)

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

一句话新闻

Windows上运行安卓你用过了吗
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。