VB 文件读取 两行

C:\123.txt,
只有两行,
要求把第一行读取赋值变量a
把第二行读取赋值变量b
或者把最后一行读取赋值变量a
把倒数第二行读取赋值变量b

dim a as string,b as string
Open "C:\123.TXT" For Input As #1
Line Input #1, a'读取第一行
Line Input #1, b '读取第二行
温馨提示:答案为网友推荐,仅供参考
第1个回答  2008-08-12
Open "C:\123.TXT" For Input As #1

Line Input #1, TextA '读取第一行
Line Input #1, TextB '读取第二行
a = TextA
b = TextB
相似回答