How to delete a given directory recursively in C# ? A directory containing files.
Should the System.IO.Directory.Delete with the second parameter true
Recursive works for both files and folders (oddly, I thought it didn't work for files; my bad...):
// create some nested folders...
Directory.CreateDirectory(@"c:\foo");
Directory.CreateDirectory(@"c:\foo\bar");
// ...with files...
File.WriteAllText(@"c:\foo\blap.txt", "blup");
File.WriteAllText(@"c:\foo\bar\blip.txt", "blop");
// ...and delete them
Directory.Delete(@"c:\foo", true); // fine