I am writing some code in C# to save an image and uses VS2005. My problem is that, I can't delete the image file that is recently created. I am getting an error message from windows " Cannot delete file. There is a sharing violation. The source or destination file may be in use."
my code is ...
Image myImage = CaptureImage(); //function to get image
myImage.Save(filePath);
myImage.Dispose();
thanks.
Can't delete the recently created image file
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Mahesh ChandRank #1 · 393.3K reputationPosted Sep 18, 2008, 8:29 AM EDT
Sen14 reputationPosted Sep 18, 2008, 9:12 PM EDT