title: Writing to a new line in Visual Basic with Streamwriter
body: <p>Every time I press "button2" it <strong>should</strong> take the data from various text boxes and write them into my text file on a new line. For some unknown reason, the program just overwrites everything in the text file, whereas I need it to write to a new line. If someone knows how to do this please let me know!</p>
  
  <p>Refer the below Code:</p>
  
  <pre><code>Public Class Form5
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Me.Hide()
      Form2.Show()
  End Sub
  
  Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
      Dim username As String = (TextBox1.Text &amp; TextBox2.Text)
      Dim password As String = "password"
      Dim forename As String = TextBox1.Text
      Dim surname As String = TextBox2.Text
      Dim dob As String = TextBox3.Text
      Dim phone As String = TextBox4.Text
      Dim address As String = TextBox5.Text
      Dim filename As String = "../../usernamepassword.txt"
      Dim objreader As New System.IO.StreamWriter(filename)
      objreader.WriteLine(username &amp; "," &amp; password &amp; "," &amp; forename &amp; "," &amp; surname &amp; "," &amp; dob &amp; "," &amp; phone &amp; "," &amp; address &amp; ",")
      objreader.Close()
  End Sub
  </code></pre>