(Get "Temporary Internet Files" directory and files)
const int cookies = 32;
Shell32.Folder objFolder;
Shell32.FolderItems objFolderItems;
Shell32.ShellClass objShell;
string strFolderpath = System.IO.Path.GetTempPath().Substring(0, System.IO.Path.GetTempPath().Length - 1) + "orary Internet Files\\";
objShell = new Shell32.ShellClass();
objFolder = objShell.NameSpace(cookies);
objFolderItems = objFolder.Items();
foreach (Shell32.FolderItem objFolderItem in objFolderItems)
{
//MessageBox.Show(strFolderpath+objFolderItem.Path.ToString());
string strDeleteFile = strFolderpath + objFolderItem.Path.ToString();
File.Delete(strDeleteFile);//delete cannot
}
claverchou 0 Newbie Poster
claverchou 0 Newbie Poster
claverchou 0 Newbie Poster
claverchou 0 Newbie Poster
jchandramouli 0 Newbie Poster
Illaya 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.