title: VB.NET: Readline from line until end
body: <p>I want to ask if there's a way to use "readline", that it reads from a certain line until the end of the file.
  I need it because the user can save values from the program to a text file. Later he has a possibility to call the values back to the main program( ex. he wants to edit the values)</p>
  
  <p>Everything works fine, but I have a multiline textbox, and if the user press ENTER, then after saving its immpossible to get the data in the right possition.
  What I search, is a way to tell the program, to read from line 20 until the end of the file</p>
  
  <p>My Text saving code</p>
  
  <pre><code>Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
      Dim Saveb As New SaveFileDialog()
      Dim myStreamWriter As System.IO.StreamWriter
      Saveb.Filter = "Text [*.txt*]|*.txt|All Files [*.*]|*.*"
      Saveb.CheckPathExists = True
      Saveb.CreatePrompt = False
      Saveb.FileName = "b" &amp; (TextBox1.Text)
      Saveb.Title = "Speichern"
      Saveb.ShowDialog(Me)
      Try
          myStreamWriter = System.IO.File.AppendText(Saveb.FileName)
          myStreamWriter.WriteLine(TextBox1.Text)
          myStreamWriter.WriteLine(TextBox13.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox14.Text &amp; ".")
          myStreamWriter.WriteLine(ComboBox5.Text &amp; ".")
          myStreamWriter.WriteLine(ComboBox6.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox4.Text &amp; ".")
          myStreamWriter.WriteLine(SrNr.Text &amp; ".")
          myStreamWriter.WriteLine(ComboBox4.Text &amp; ".")
          myStreamWriter.WriteLine(ComboBox2.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox5.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox6.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox7.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox8.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox9.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox10.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox2.Text &amp; ".")
          myStreamWriter.WriteLine(ComboBox1.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox14.Text &amp; ".")
          myStreamWriter.WriteLine(TextBox11.Text &amp; ".")
          myStreamWriter.WriteLine(ComboBox3.Text)
          myStreamWriter.WriteLine(TextBox12.Text &amp; ".")
  
          myStreamWriter.Flush()
      Catch ex As Exception
      End Try
  End Sub
  </code></pre>
  
  <p>And this is my reading code</p>
  
  <pre><code> Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
      Static count As Integer
      count = count + 1
      OpenFileDialog1.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
      OpenFileDialog1.Filter = "All Files (*.*)|*.*|Excel files (*.xlsx)|*.xlsx|CSV Files (*.csv)|*.csv|XLS Files (*.xls)|*xls"
      If (OpenFileDialog1.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
          Dim read As IO.StreamReader
          read = IO.File.OpenText(OpenFileDialog1.FileName)
          TextBox17.Text = read.ReadToEnd()
          largetext.Text = read.ReadToEnd()
          read.Close()
          Dim readLines() As String = IO.File.ReadAllLines(OpenFileDialog1.FileName)
          TextBox1.Text = readLines(0)
          TextBox13.Text = readLines(1)
          TextBox14.Text = readLines(2)
          ComboBox5.Text = readLines(3)
          ComboBox6.Text = readLines(4)
          TextBox4.Text = readLines(5)
          SrNr.Text = readLines(6)
          ComboBox4.Text = readLines(7)
          ComboBox2.Text = readLines(8)
          TextBox5.Text = readLines(9)
          TextBox6.Text = readLines(10)
          TextBox7.Text = readLines(11)
          TextBox8.Text = readLines(12)
          TextBox9.Text = readLines(13)
  
          TextBox10.Text = readLines(14)
          TextBox2.Text = readLines(15)
          ComboBox1.Text = readLines(16)
          TextBox14.Text = readLines(17)
          TextBox11.Text = readLines(18)
          ComboBox3.Text = readLines(19)
          TextBox12.Text = readLines(20)
      End If
  End Sub
  </code></pre>
  
  <p>The code gets into a hidden Textbox, from there it gets into the right place.
  I know its not professional, but Im newbie.</p>