Hi to all I'm writtting a small application, that one of its options will be delete Internet Temporary Files(Cache of IE).
I try deleting the files but without any success. I found an example of code in the web, but when I use the code I receive a error that I don't have the permissions.
This is the code I'm using, I hope you can help me
void ClearFolder(DirectoryInfo folder)
{
foreach (FileInfo file in folder.GetFiles())
{ file.Delete(); }
foreach (DirectoryInfo subfolder in folder.GetDirectories())
{ ClearFolder(subfolder); }
}
And call the method like:
ClearFolder(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)));
:'(
Thanks