how to delete a directory if exists in c# code example Example: C# delete folder with all contents System.IO.Directory.Delete("C:\TempTest", True)