7,765
社区成员
发帖
与我相关
我的任务
分享
Dim TextLine
dim i as Integer
i=1
Open "输出文件名" For Output As #2 ' 打开输出文件。
Open "输入文件名" For Input As #1 ' 打开文件。
Print #1, "This is a test"
Do While Not EOF(1) ' 循环至文件尾。
Line Input #1, TextLine ' 读入一行数据并将其赋予某变量。
Print #1, i & " ¦" & TextLine
i=i+1
Loop
Close #1 ' 关闭文件。
Close #2 ' 关闭文件。