Open app.path & "\A.txt" For Input As #1 i = 0 Do While Not EOF(1) ' 循环至文件尾。 i = i + 1 If i = 2 Then ‘修改此处数值 Line Input #1, TextLine ' 读入一行数据并将其赋予某变量。 Text1.Text = TextLine Exit Do End If Loop Close #1
第2个回答 2011-08-24
Open app.path & "\A.txt" For Input As #1 i = 0 Do While Not EOF(1) ' 循环至文件尾。 i = i + 1 If i = 1 Then Line Input #1, TextLine ' 读入一行数据并将其赋予某变量。 Text1.Text = TextLine Exit Do End If Loop Close #1追问
我要的是只显示第二行的数据啊!!
本回答被提问者采纳
第3个回答 2011-08-24
Open app.path & "\A.txt" For Input As #1 Dim TextLine As String Line Input #1, TextLine Line Input #1, TextLine Text1.Text = TextLine Close #1