List<string> keys = new List<string>();
// retrieve application Cache enumerator
IDictionaryEnumerator enumerator = HttpRuntime.Cache.GetEnumerator();
// copy all keys that currently exist in Cache
while (enumerator.MoveNext())
{
keys.Add(enumerator.Key.ToString());
}
// delete every key from cache
for (int i = 0; i < keys.Count; i++)
{
HttpRuntime.Cache.Remove(keys[i]);
}
Asp.Net缓存清理
作者:于为源
出处: http://www.cnblogs.com/yuanyuan/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。