发布网友 发布时间:2022-04-26 02:24
共2个回答
热心网友 时间:2022-06-20 01:25
Dim num As Integer
Dim r As String
Dim f As String
'将f指定为你的文件的路径
f = "t.txt"
num = FreeFile()
Open f For Input As num
While Not EOF(num)
Line Input #num, r
MsgBox (r)
Wend
热心网友 时间:2022-06-20 01:25
Dim fso
Dim txtfile
Set fso = CreateObject("scripting.filesystemobject")
Set txtfile = fso.OpenTextFile("E:\test\12345678FAIL.txt")
txtfile.ReadLine '读取一行
txtfile.ReadAll '读取所有追问怎么一行一行遍历呢?
我现在用的方法是line