Asp.Net缓存清理
2012-11-17 20:05 于为源 阅读(274) 评论(0) 编辑 收藏 举报 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]);
}
本文来自博客园,作者:于为源,转载请注明原文链接:https://www.cnblogs.com/yuanyuan/archive/2012/11/17/2775214.html
如果对您有帮助,您也可以请我喝杯可乐。