title: Can I take the ownership of lock when trying to open and write a file through StreamWriter?
body: <p>I use StreamWriter to write logs. I sometimes open this log file with Excel while my program is running.
  I find that Excel lock this file so I get IOException when my program try to write logs.</p>
  
  <p>Can I take out the lock which was set by other process?
  I know I can lock the file while my program is running but it cause similar problem when I open it with Excel.
  Note that I won't write anything with the other process.</p>
  
  <pre><code>        using(var sw = new StreamWriter(
              new FileStream(filename, FileMode.Append, FileAccess.Write), Encoding.GetEncoding("UTF-16")))
  </code></pre>