open "c:qq.txt" for input as #1 while not eof(1) line input #1,txt text1.text=text1.text & txt & vbcrlf wend close #1
dim fso as new filesystemobject dim txt as textstream set txt = fso.opentextfile("文件名",forreading) do while not txt.eof msgbox txt.readline loop
Dim filetxt As String, x As Variant, i As Integer filetxt = String(FileLen(filepath), " ") Open filepath For Binary As 1 Get #1, , filetxt Close 1 x = Split(filetxt, vbCrLf) x(i-1) 就是第i行内容
while not eof(1)
line input #1,txt
text1.text=text1.text & txt & vbcrlf
wend
close #1
dim txt as textstream
set txt = fso.opentextfile("文件名",forreading)
do while not txt.eof
msgbox txt.readline
loop
filetxt = String(FileLen(filepath), " ")
Open filepath For Binary As 1
Get #1, , filetxt
Close 1
x = Split(filetxt, vbCrLf)
x(i-1) 就是第i行内容