public void Empty(System.IO.DirectoryInfo directory) { try { foreach (System.IO.FileInfo file in directory.GetFiles()) file.Delete(); foreach (System.IO.DirectoryInfo subDirectory in directory.GetDirectories()) subDirectory.Delete(true); } catch (Exception e) { Console.WriteLine(e); } }