billyzhang0609 发表于 2014-9-2 16:15
我已经补充了问题,添加了附件。
Private Sub Command1_Click()
Open "C:\Users\lenovo\Desktop\test1\test1\3.txt" For Input As #1
n = 0
Do While Not EOF(1)
Line Input #1, S$
If S$ <> "" Then n = n + 1
Loop
Close #1
MsgBox "D:\111.txt 共有 " & n & " 行。"
End Sub
因为3.txt 存在1条空行