Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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



Make sure you have not opened a file in any previous statement.
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900