public static void ClearStartCache(string keyStart) { List<string> cacheKeys = new List<string>(); System.Web.Caching.Cache _cache = HttpRuntime.Cache; var cacheEnum=_cache.GetEnumerator(); while (cacheEnum.MoveNext()) { string keyStr = cacheEnum.Key.ToString(); if (keyStr.StartsWith(keyStart)) { cacheKeys.Add(keyStr); } } foreach (string cacheKey in cacheKeys) { _cache.Remove(cacheKey); } }
转载于:https://www.cnblogs.com/xiaoruilin/p/9890331.html
最后
以上就是天真芝麻最近收集整理的关于清除 System.Web.Caching.Cache 以"xxx"开头的缓存的全部内容,更多相关清除内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复