Sen

Sen

  • NA
  • 64
  • 0

Can't delete the recently created image file

Sep 18 2008 8:51 AM
        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.



Answers (2)