Const ForReading = 1,ForWriting =2
Dim fso,f
Dim myarray(5)
Set fso = createobject("Scripting.FileSystemObject") '创建对象
Set f=fso.OpenTextFile("d:\hello.txt",ForReading) '读文件
i = 1
While f.atendofline<>true ''是否最后一行
myarray(i) = f.readline
msgbox myarray(i) '将每行内容保存在数组中
i = i +1
Wend
f.close
Set fso = nothing