Skip to content

Instantly share code, notes, and snippets.

@facebookegypt
Created February 5, 2014 14:26
Show Gist options
  • Save facebookegypt/8824653 to your computer and use it in GitHub Desktop.
Save facebookegypt/8824653 to your computer and use it in GitHub Desktop.
VB 2010 Read Text Files
'Visual basic online course
'Read Text Files in VB 2010
Private Sub Form1_Load(sender As System.Object, _
e As System.EventArgs) Handles MyBase.Load
'Path to file
Dim LocalFilePath As String = Application.StartupPath & "\MyFile.txt"
Dim fileReader As String
FileReader = My.Computer.FileSystem.ReadAllText(LocalFilePath,
System.Text.Encoding.ASCII)
TxtFromFile.Text = FileReader
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment