Option Explicit On
Option Strict On
Imports System.IO
Module Program
Sub Main()
' 将f指定为你要读取的文件的路径
Const f As String="t.txt"
Dim line As String=Nothing
Using sr As StreamReader=New StreamReader(f)
Do
line=sr.ReadLine()
If line IsNot Nothing Then
Console.WriteLine(line)
If MsgBoxResult.Yes<>MsgBox("是否继续?", MsgBoxStyle.YesNo) Then
Exit Do
End If
End If
Loop While line IsNot Nothing
End Using
Console.Write("Press any key to continue . . . ")
Console.ReadKey(True)
End Sub
End Module
温馨提示:答案为网友推荐,仅供参考