"The process cannot access the file 'D:\dup.jpg' because it is being used by another process."
<p>Can anyone guide me in this issue..</p>

<p>How can i avoid this exception in VC# -- </p>

<blockquote>
  <p>"The process cannot access the file 'D:\dup.jpg' because it is being
  used by another process."</p>
</blockquote>

<p>Have a solution from Adi which doesnt worked out at all..</p>

<p>Snippet of Code is here ..</p>

<pre><code>using (FileStream firstImageStream = 
    new FileStream(firstImage.FullName, FileMode.Open))
{
    using (FileStream secondImageStream = 
        new FileStream(secondImage.FullName, FileMode.Open))
    {
        hashingTool = new SHA256Managed();
        Byte[] imageOneHash = hashingTool.ComputeHash(firstImageStream);
        Byte[] imageTwoHash = hashingTool.ComputeHash(secondImageStream);
        hashingTool.Clear();
    }
}
</code></pre>
