I would like to know the way in which my folders should be deleted within my C # application, the images that are inside my folders are in use, not all of them only, so I would like to know how to remove that use or close the image before deleting so that when you get to the command you can do the deletion correctly.
Current Code:
string directorio = @"..\..\Imagenes\Imagenes_Modal\Usuario\Abril";
if (Directory.Exists(directorio)) {
Directory.Delete(directorio,true);
}
The error I get is the following:
The process can not access the file 'Abril0.jpeg' because is being used in another process.