title: Is there a way to use "using" but leave file open?
body: <p>Generally, "using" is preferred approach for accessing and disposing of a filestream properly.</p>
  
  <p>I often need to leave the file open (as below). Can the "using" structure be employed in this case?</p>
  
  <pre><code>public class logger
  {
      private StreamWriter sw;
      public logger(string fileName)
      {
          sw = new StreamWriter(fileName, true);
      }
  
      public void LogString(string txt)
      {
          sw.WriteLine(txt);
          sw.Flush();
      }
  
      public void Close()
      {
          sw.Close();
      }
  }
  </code></pre>