Answer to Question #267961 in Visual Basic for ray

Question #267961

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.


1
Expert's answer
2021-11-24T01:40:28-0500
   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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS