Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.
Dim list As New List(Of String) ' Open file.txt with the Using statement. Using r As StreamReader = New StreamReader("C:\temp\Output.txt") ' Store contents in this String. Dim line As String ' Read first line. line = r.ReadLine ' Loop over each line in file, While list is Not Nothing. Do While (Not line Is Nothing) ' Add this line to list. list.Add(line) 'Me.ListBox1.Items.Add(line) ' Display to console. 'Console.WriteLine(line) ' Read in the next line. line = r.ReadLine Loop End Using