New feature! Upgrade and increase expert visibility of your issues with Priority Questions.
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
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.