如何一行行地讀取文件?
dim input(30)
' 定義一個數(shù)組,大小可隨時更改.這里為了顯示方便.
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
' 將文件內(nèi)容讀入input數(shù)組.
Loop
file_open.close
Set fs=Nothing
另外,對于二進制數(shù)據(jù),我們也可以用Read()來讀取,如:
file_open.Read(200)
就是讀取file_open中的200個數(shù)據(jù)。
相關(guān)文章
CPU,GPU,DPU,TPU,NPU,BPU等處理器的性能及概念
CPU,GPU,DPU,TPU,NPU,BPU各種U還在傻傻分不清么?本文帶你領(lǐng)略這些不同的U所代表的意義,讓你有醍醐灌頂般的醒悟收獲,有需要的朋友可以借鑒參考2021-08-08