title: how do you save from a savefile dialog in C#?
body: <p>here is the code I am currently using to open a file using the openfiledialog             `        </p>
  
  <pre><code>    private void openToolStripMenuItem_Click_1(object sender, System.EventArgs e)
      {
          //opens the openfiledialog and gives the title.
          openFileDialog1.Title = "openfile";
          //only opens files from the computer that are text or richtext.
          openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
          //gets input from the openfiledialog.
          if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
          {
              //loads the file and puts the content in the richtextbox.
              System.IO.StreamReader sr = new
     System.IO.StreamReader(openFileDialog1.FileName);
              richTextBox1.Text = (sr.ReadToEnd());
              sr.Close();`                                                                                               here is the code I am using to save through a savefiledialog          `   
  
      Stream mystream;
      private void saveToolStripMenuItem_Click(object sender, EventArgs e)
      {
          SaveFileDialog saveFileDialog1 = new SaveFileDialog();
  
          saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
          saveFileDialog1.FilterIndex = 2;
          saveFileDialog1.RestoreDirectory = true;
  
          if (saveFileDialog1.ShowDialog() == DialogResult.OK)
          {
              if ((mystream = saveFileDialog1.OpenFile()) != null)
              {
                  StreamWriter wText = new StreamWriter(mystream);
  
                  wText.Write("");
  
                  mystream.Close();
  </code></pre>
  
  <p>`
               It allows me to open text files but I can't save changes nor create my own text file. no errors are shown during run time. Thanks again for the extra help.</p>