title: StreamWriter object doesn't work at all
body: <p>This code works fine within <code>SaveFileDialog</code></p>
  
  <pre><code>private void buttonSaveAs_Click(object sender, EventArgs e)
          {
              try
              {
                  if (selectedFileInfo != null)
                  {
                      // Save File
                      SaveFileDialog saveFileDialog1 = new SaveFileDialog();
                      saveFileDialog1.InitialDirectory = explorerTree2.SelectedPath; 
                      // set a default file name
                      saveFileDialog1.FileName = Path.GetFileNameWithoutExtension(selectedFileInfo.Name) + "-COPY" + selectedFileInfo.Extension;
                      // set filters - this can be done in properties as well
                      saveFileDialog1.Filter = "HTM files (*.htm)|*.htm|HTML files (*.html)|*.html|XML files (*.xml)|*.xml|Text files (*.txt)|*.txt|All files (*.*)|*.*";
  
                      #region Define filter index
  
                      if (selectedFileInfo.Extension.Equals(".htm")) // HTM files (*.htm)|*.htm
                      {
                          saveFileDialog1.FilterIndex = 1;
                      }
                      else // All files (*.*)|*.*
                      {
                          saveFileDialog1.FilterIndex = 5;
                      }
  
                      #endregion
  
                      if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                      {
                          using (StreamWriter sw = new StreamWriter(saveFileDialog1.FileName))
                          { 
                              sw.Write(scintilla1.Text);
                              sw.Flush();
                              sw.Close();
                          }
                      }
                  }
              }
              catch (IOException ex)
              {
                  MessageBox.Show(ex.Message);
              }
              catch (Exception ex)
              {
                  MessageBox.Show(ex.Message);
              }
          }
  </code></pre>
  
  <p>And another does not. And there NO is any error as well.  Any clue?</p>
  
  <pre><code>private void buttonSave_Click(object sender, EventArgs e)
  {
      try
      {
          if (selectedFileInfo != null)
          {
              using (FileStream fs = new FileStream(selectedFileInfo.Name, FileMode.OpenOrCreate, FileAccess.ReadWrite))
              {
                  StreamWriter sw = new StreamWriter(fs);
                  sw.AutoFlush = true;
                  sw.Write(scintilla1.Text);                       
                  sw.Flush();
                  sw.Close();
              }
  
          }
      }
      catch (IOException ex)
      {
          MessageBox.Show(ex.Message);
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message);
      }
  }
  </code></pre>
  
  <p><strong>P.S. This option does not work as well</strong></p>
  
  <pre><code> using (FileStream fs = new FileStream(selectedFileInfo.Name, FileMode.OpenOrCreate, FileAccess.ReadWrite))
     {
           using (StreamWriter sw = new StreamWriter(fs))
           {
                 sw.AutoFlush = true;
                 sw.Write(scintilla1.Text);
                 sw.Flush();
                 sw.Close();
           } 
  }
  </code></pre>