title: Append text using StreamWriter
body: <p>This is probably a pretty simple question.  In C# I'm trying to write a simple method, called my "DebugWrite" method, to write out any exceptions caught within my program to a text file stored locally. My current code only writes a new file every time, using StreamWriter</p>
  
  <p>How do you program it to check if the file already exists, and if so to append to the current text?.  IE:</p>
  
  <pre><code>If(~Exist(debug.txt)
  {
    Write new debug.txt.
  }
  else if(exist(debug.txt))
  {
    Append new text.
  }
  </code></pre>