public void FolderDel(DirectoryInfo path)
{
DirectoryInfo[] Directories = path.GetDirectories();
foreach (DirectoryInfo driectiory in Directories)
{
FolderDel(driectiory);
}
FileInfo[] files = path.GetFiles();
foreach (FileInfo file in files)
{
if (file.Attributes.ToString() != "Normal")
{
File.SetAttributes(file.FullName, FileAttributes.Normal);
}
File.Delete(file.FullName);
}
Directory.Delete(path.FullName);
}