Directory.Delete(@"folderPath", true);
public static void RecursiveDelete(DirectoryInfo parentDir)
{
if (parentDir.Exists)
{
foreach (var dir in parentDir.EnumerateDirectories())
{
RecursiveDelete(dir);
}
var files = parentDir.GetFiles();
foreach (var item in files)
{
item.IsReadOnly = false;
item.Delete();
}
parentDir.Delete(true);
}
}