title: How can I delete a file that is in use by another process?
body: <p>When I try to delete a file occurs the following exception: </p>
  
  <blockquote>
    <p>The process cannot access the file ''
    because it is being used by another
    process.</p>
  </blockquote>
  
  <p>My code looks like:</p>
  
  <pre><code>string[] files = Directory.GetFiles(@"C:\SEDocumentConverter\SOURCE");
  foreach (string file in files)
  {               
     File.Delete(file);
  }
  </code></pre>
  
  <p>How can I solve this problem?</p>