code for:
Put a button titled Open Answers File. When this button is clicked; open Answer.txt, and read and store the answers in an array of Strings. Close this file.
Private answers(100) As String
Private Sub btnOpenAnswersFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenAnswersFile.Click
Dim line As String
Dim FilePath As String = "Answer.txt"
Using reader As StreamReader = New StreamReader(FilePath)
' Read one line from file
line = reader.ReadLine()
End Using
Dim c As Integer = 0
For Each l In line
answers(c) = l
c += 1
Next
End Sub
Comments
Leave a comment