0

i try to make a temp cleaner and the program it self works but how can i write the programm that it skips the files that are currently in use?

here is the script i used

System.IO.DirectoryInfo di = new DirectoryInfo(path);

    foreach (FileInfo file in di.GetFiles())
    {
        file.Delete(); 
    }
    foreach (DirectoryInfo dir in di.GetDirectories())
    {
        dir.Delete(true); 
    }
Exil_S
  • 1
  • 2

0 Answers0