示例#1
0
        public static bool RemoveCache(string cacheKey, params string[] keyParms)
        {
            string key = string.Format(cacheKey, keyParms);
            bool   res = MemCacheHelper.RemoveObject(key);

            return(res);
        }
示例#2
0
        public static bool SetCache(string cacheKey, object value, params string[] keyParms)
        {
            string    key       = string.Format(cacheKey, keyParms);
            CacheInfo cacheInfo = GetCacheInfo(cacheKey);

            if (null == cacheInfo)
            {
                return(false);
            }
            //if (cacheInfo.CacheType == "21")//IIS缓存
            //{
            //    HttpContext.Current.Cache.Insert(key, value, null, DateTime.MaxValue, new TimeSpan(0, 0, cacheInfo.CacheTime, 0));
            //}
            //else if (cacheInfo.CacheType == "22")//Memcache缓存
            //{

            //}
            bool res = MemCacheHelper.SetObject(key, value, cacheInfo.CacheTime);

            return(res);
        }