using System.IO;
void clearIECache()
{
ClearFolder (new DirectoryInfo (Environment.GetFolderPath
(Environment.SpecialFolder.InternetCache)));
}
void ClearFolder (DirectoryInfo folder)
{
foreach (FileInfo file in folder.GetFiles())
{ file.Delete(); }
foreach (DirectoryInfo subfolder in folder.GetDirectories())
{ ClearFolder(subfolder); }
}
public static void Main( )
{
new Test().clearIECache ();
}
ll this be helpfull to clear cache of client browser
ReplyDeletepublic static class SingleTon
ReplyDelete{
public static void ClearCache()
{
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetExpires(DateTime.Now);
HttpContext.Current.Response.Cache.SetNoServerCaching();
HttpContext.Current.Response.Cache.SetNoStore();
}
}
And on page load use this..
protected void Page_Load(object sender, EventArgs e)
{
SingleTon.ClearCache();
}
It appear "Confirm Form Resubmission" when i click previous button of browser, and it will go to login page after i click on refresh browser of button.
ReplyDeletei need for clearing history for chrome browser how to write
ReplyDelete(c# windows form app) just only one button i will click then clear the history how to?