99问答网
所有问题
VB6.0读取TXT的问题
就是循环读取,第一次读取第一行,第二次读取第二行,直到TXT的所有行都读取了才结束,该怎么写?(加分)
举报该问题
推荐答案 2011-07-14
Dim TextLine
Open "TESTFILE" For Input As #1 ' 打开文件。
Do While Not EOF(1) ' 循环至文件尾。
Line Input #1, TextLine ' 读入一行数据并将其赋予某变量。
Debug.Print TextLine ' 在调试窗口中显示数据。
Loop
Close #1 ' 关闭文件。
他是自动读过第一行,指向第二行的,所以顺序读下去就可以了
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://99.wendadaohang.com/zd/vjvvXBeOX.html
其他回答
第1个回答 2011-07-14
dim txt as string
Open "C:\Autoexec.bat" for Input as #1
Line Input #1,txt
do while Not Eof(1)
list1.additeam txt
Line Input #1,txt
loop
close #1
相似回答
大家正在搜