title: The process cannot access the file when using StreamWriter
body: <p>Basically I want to create a file if not existing then write message to it.</p>
  
  <pre><code>if (!File.Exists(filePath + fileName))
      File.Create(filePath + fileName);
  StreamWriter sr = new StreamWriter(filePath + fileName,false);
  </code></pre>
  
  <p>How to deal with this error?</p>
  
  <blockquote>
    <p>The process cannot access the file 'c:\blahblah' because it is being used by another process.</p>
  </blockquote>