Read from a textfile

stefonalfaro

Member
Joined
Dec 3, 2007
Messages
16
Programming Experience
Beginner
How would I use the open file dialog to display text from a file into a textbox?
Im on VB2008
 
VB.NET:
If DlgOpenFile.ShowDialog() = DialogResult.OK Then
    TextBox1.Text = My.Computer.FileSystem.ReadAllText(DlgOpenFile.FileName)
End If
 
Ahh dang you JohnH, I wanted to input some stuff here but you got here first.
Anyways, if you have any desire to write to a text file, you can use this:
My.Computer.FileSystem.WriteAllText("File here", "Text To Write", True/False)
THe True/False part is whether or not to append the textfile.
You may not have needed al that, but whatever.
 
Back
Top