当前位置: 代码迷 >> ASP.NET >> 急 ! 有关缓存的有关问题
  详细解决方案

急 ! 有关缓存的有关问题

热度:9645   发布时间:2013-02-25 00:00:00.0
急 !在线等 有关缓存的问题!
如何获取所有的缓存项
 public static DataSet GetCacheByKey(string key)
 {
  //如何写
}

------解决方案--------------------------------------------------------
C# code
/// <summary>        /// 获取所有缓存对象的key        /// </summary>        /// <returns>返回一个IList对象</returns>        public static IList<string> GetKeys()        {            List<string> keys = new List<string>();            IDictionaryEnumerator cacheItem =HttpRuntime.Cache.GetEnumerator();            while (cacheItem.MoveNext())            {                keys.Add(cacheItem.Key.ToString());            }            return keys.AsReadOnly();        }
------解决方案--------------------------------------------------------
http://www.cnblogs.com/wenanry/archive/2008/08/13/1267028
  相关解决方案