title: How to read a specific line from a text file in VB
body: <p>I am creating a program that is supposed to write text into a text file, and should be able to read specific lines from a text file in VB (so if i needed to read a specific name I could select line 5 and it would display in the textbox). I am able to read the text from the text file but I do not know how to control a specific line.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Public Class Form1
  
      Private Sub btnSubmit_Click(sender As System.Object, e As System.EventArgs) Handles btnSubmit.Click
           Dim writer As New System.IO.StreamWriter("/text.txt", True)
           writer.WriteLine(txtFirstName.Text)
           writer.WriteLine(txtLastName.Text)
           writer.WriteLine("-------------------------------------")
           writer.Close()
      End Sub
  
       Private Sub btnRead_Click(sender As System.Object, e As System.EventArgs) Handles btnRead.Click
          Dim reader As New System.IO.StreamReader("/text.txt")
          Dim FirstName, LastName As String
          FirstName = reader.ReadLine()
          LastName = reader.ReadLine()
          reader.Close()
          txtFirstName.Text = FirstName
          txtLastName.Text = LastName
      End Sub
  
      Private Sub btnClear_Click(sender As System.Object, e As System.EventArgs) Handles btnClear.Click
          txtFirstName.Clear()
          txtLastName.Clear()
      End Sub
  End Class
  </code></pre>
  
  <p>Any help would be appreciated. Thanks!</p>