有关文件的逐行存储
我现在要读一个文件,用一个数组存储文件的每一行,即a(0)存第一行,a(1)存第二行...怎么操作?
[解决办法]
Dim fsoTxt As New FileSystemObject, tsTxt As TextStream
Dim i As Integer
Dim J As Integer
Set tsTxt = fsoTxt.OpenTextFile(AppfileName, ForReading)
tsTxt.ReadAll
J = tsTxt.Line
tsTxt.Close
Set tsTxt = fsoTxt.OpenTextFile(AppfileName, ForReading)
For i = 0 To J - 1
a(i) = tsTxt.ReadLine
Next
tsTxt.Close