Friday, June 3, 2011

Clear cache of your PC using ASP.NET(C#)

You can use following function to clear cache of your PC using ASP.NET(C#).

public static void CacheClear()
{
    foreach (System.Collections.DictionaryEntry DE in HttpContext.Current.Cache)
    {
        string Key = DE.Key.ToString();
        HttpContext.Current.Cache.Remove(Key);
    }
}