C# delete all files and folders in multiple directory but leave the directoy
- by NightsEVil
well i like this nice of code right here it seems to work awsome but i cant seem to add any more directories to it
{
DirectoryInfo dir = new DirectoryInfo(@"C:\temp");
foreach(FileInfo files in dir.GetFiles())
{
files.Delete();
}
foreach (DirectoryInfo dirs in dir.GetDirectories())
{
dirs.Delete(true);
}
}
i would also like to add in special folders aswell like History and cookies and such how would i go about doing that (i would like to include atleast 4-5 different folders)