Delete IE Temp files
We can delete the temporary files of IE.
Following are the code part of delete the files.
using System.IO;
public static void Main()
{
ClearIETemp(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)));
}
void ClearIETemp(DirectoryInfo MyDirPath)
{
foreach (FileInfo MyFile in MyDirPath.GetFiles())
{
MyFile.Delete();
}
foreach (DirectoryInfo MySubFolder in MyDirPath.GetDirectories())
{
ClearIETemp(MySubFolder);
}
}
1. By using "Environment.SpecialFolder.InternetCache" we can get the
temp folder of IE files
2. The method "ClearIETemp" is used to deleted each file of the tempory files
3. recursive call of this method deleted all the subdirectory files also.
Thanks
Nathan
