我正在创建一个视频游戏,我需要一次显示一个字符,而互联网的其余部分几乎没有帮助,因为它们适用于我一无所知的旧版本的 Visual Basic。
这是我的错误代码:
Dim outfile As IO.StreamWriter
Dim infile As IO.StreamReader
Private Sub StartScreen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strTitle As String = " "
Dim strText() As String = {}
Dim intLoop As Integer = 0
If IO.File.Exists("save.txt") = False Then
outfile = IO.File.CreateText("save.txt")
End If
infile = IO.File.OpenText("save.txt")
Do Until infile.Peek = -1
strText(intLoop) = infile.Read
System.Threading.Thread.Sleep(1000)
intLoop += 1
Loop
intLoop = 0
Do While strText.Length <> intLoop
strTitle = strText(intLoop)
lblTitle.Text = lblTitle.Text & strTitle
intLoop += 1
Loop
infile.Close()
outfile.Close()
End Sub