Can anyone tell me whats wrong with this code? I keep getting a streamreader error.
I have added Imports System.IO at the top of the code to import the streamreader class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
read test.txt
Dim streamtodisplay As streamreader
streamtodisplay = New streamreader("c:\test.txt")
TextBox1.Text = streamtodisplay.readtoend
streamtodisplay.close()
TextBox1.Select(0, 0)
End Sub
I have added Imports System.IO at the top of the code to import the streamreader class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
read test.txt
Dim streamtodisplay As streamreader
streamtodisplay = New streamreader("c:\test.txt")
TextBox1.Text = streamtodisplay.readtoend
streamtodisplay.close()
TextBox1.Select(0, 0)
End Sub