Dim appdisk$, aa$, tmpstr$(), i&, n& 'str 别把它当变量名称使用
Private Sub Command1_Click()
appdisk = Trim(App.Path) '你不判断的话qq.txt在c:\时便会出错
If Right(appdisk, 1) <> "\" Then appdisk = appdisk & "\"
If Dir(appdisk & "qq.txt") <> "" Then
Open appdisk & "qq.txt" For Input As #1
n = 0
While Not EOF(1)
ReDim Preserve tmpstr$(n)
Line Input #1, aa
tmpstr(n) = aa
n = n + 1
Wend
Close #1
For i = 0 To n - 1
Print tmpstr(i)
Next i
Else
MsgBox "无此文件"
End If
End Sub