The process cannot acess the file as it is used by other process when trying to delete files from a directory
<p>Hi I am trying to delete files from a directory.It is able to delete the first file ,but after that
it is not able to delete other files.It is showing error message "the process cannot access the file as it used by other process.
My code for deleting is </p>

<pre><code>             foreach(FileInfo file in files)
             {
            file.delete()
              }
</code></pre>

<p>Please help</p>
