dim fn as integer dim str as string fn=freefile() open filepath for input as #fn do while not eof(#fn) line input #filenumber,str list1.AddItem str loop close #fn
修改后的代码是: Dim fn As Integer Dim str As String fn = FreeFile() Open "D:\AAA\Data.dat" For Input As #fn Do While (Not EOF(fn)) Line Input #fn, str List1.AddItem str Loop Close #fn
dim str as string
fn=freefile()
open filepath for input as #fn
do while not eof(#fn)
line input #filenumber,str
list1.AddItem str
loop
close #fn
Dim fn As Integer
Dim str As String
fn = FreeFile()
Open "D:\AAA\Data.dat" For Input As #fn
Do While (Not EOF(fn))
Line Input #fn, str
List1.AddItem str
Loop
Close #fn