Deleteing an image in run time
- by Nadav Stern
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