title: Saving data from textboxes into text file
body: <p>I am trying to write a program to me should be a lot easier than it is proving.<br>
  I have a form with text boxes that asks the user to enter their details e.g. Name, Address etc.. What I am trying to achieve is to save the data from the text boxes into a .txt file when the user hits the save button. </p>
  
  <p>I am able to create the file but the data will not save into the file. 
  I have posted my code below, and any help you may have will be greatly appreciated.</p>
  
  <pre><code>private void btnSave_Click(object sender, EventArgs e)
  {
      string file_name = "e:\\test1.txt";
  
      System.IO.StreamWriter objWriter;
      objWriter = new System.IO.StreamWriter(file_name, true);
  
      objWriter.Write(txtName.Text);
      objWriter.Write(txtAddress.Text);
      objWriter.Write(txtEmail.Text);
      objWriter.Write(txtPhone.Text);
  
      MessageBox.Show("Details have been saved");
  }
  </code></pre>