Deleteing an image in run time

Posted by Nadav Stern on Stack Overflow See other posts from Stack Overflow or by Nadav Stern
Published on 2010-12-21T11:32:24Z Indexed on 2010/12/21 11:54 UTC
Read the original article Hit count: 298

Filed under:
|
|

hey, i am trying to delete an image with the method: (the file path is correct by 100%)

if(File.Exists(filePath))
   File.Delete(filePath);

and i am getting the following exception : An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll

Additional information: The process cannot access the file 'C:\visual_programming\yad2\yad2\bin\Debug\images\1.jpg' because it is being used by another process.

thanks in advance for your help

© Stack Overflow or respective owner

Related posts about wpf

Related posts about image