这是我的代码,我想读取我的 TestFile.txt 文件并将其显示在 txt2.Text 中,但此代码不读取我的 txt 文件。谁能帮我解决这个问题?谢谢
Dim MyFileName As String = "C:\Users\TestFile.txt"
Dim Line As String = ""
Dim sb As New StringBuilder
Using sr As New StringReader(MyFileName)
Line = sr.ReadLine
Do
If Line = "*" Then
Line = sr.ReadLine
Do
sb.Append(LineRead)
Line = sr.ReadLine
Loop Until Line = "**"
End If
Line = sr.ReadLine
Loop Until Line = ""
End Using
Line = txt2.Text