Click here to Skip to main content
14,599,112 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am Showing image thumbnails in vb.net winodws application form in panel.
but while deleting with function
System.IO.File.Delete(finalunzipPath & "\001.jpg")

Showing exception as
The process cannot access the file 'D:\TempUnZip\Temp1\01.jpg' because it is being used by another process.

But if i remove that file manually from that location then it deleted what is the solution to delete file programmatically such as i can provide delete file option to user..
is there any tutorial available where show image thmbnails with delete option..
I used image object as
imgThumb = img.GetThumbnailImage(115, 115, Nothing, New IntPtr())

for generating thumbnails and finally i am doing
img = Nothing
            objPic = Nothing
            imgThumb = Nothing

but still problem is coming
Posted
Updated 29-Mar-12 20:29pm
v2

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

what do u do before executing
System.IO.File.Delete(finalunzipPath & "\001.jpg")



Make sure you have not opened a file in any previous statement.
   
Comments
vishal_h 30-Mar-12 2:29am
   
I used image object as
imgThumb = img.GetThumbnailImage(115, 115, Nothing, New IntPtr())
for generating thumbnails and finally i am doing
img = Nothing
objPic = Nothing
imgThumb = Nothing
but still problem is coming

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100