visual studio c# delete folder and contents code example Example: C# delete folder with all contents System.IO.Directory.Delete("C:\TempTest", True)