Implementing IDisposable in File.Delete method?
<p>I want to delete a file on my computer but the app throws an exception that The directory is busy. My first thought is to implement a dispose method in my class which does a file delete. 
Knows anybody how to do this? </p>

<p>It's actually a Picturebox which displays a image and if you click on a button beside the image you can remove it, thus deleting it. It's propably that which blocks my filepath.</p>

<pre><code>picobx.Image = Image.FromFile(//path)
</code></pre>

<p>Is there any solution to this? </p>

<p>PS. I want to dispose the resource so that I can delete... </p>

<p>do like this: </p>

<pre><code>File.Delete(// path )
</code></pre>
