Beispiel #1
0
        protected void SetDepend(string key, object output)
        {
            MemCachedStrategy mc = new MemCachedStrategy();

            mc.TimeOut = MemcachedCacheTime;
            mc.AddObject(key, output);
        }
Beispiel #2
0
        protected void SetDepend(string key, object output, string dependKey, int timeout)
        {
            MemCachedStrategy mc = new MemCachedStrategy();

            mc.TimeOut = timeout;
            mc.AddObjectWithDepend(key, output, dependKey);
        }
Beispiel #3
0
        public void SetDepend(string key, object output, string dependKey)
        {
            MemCachedStrategy mc = new MemCachedStrategy();

            mc.TimeOut = MemcachedCacheTime;
            string[] temp = { dependKey };
            mc.AddObjectWithDepend(key, output, temp);
        }
Beispiel #4
0
 protected object GetDepend(string key)
 {
     try
     {
         MemCachedStrategy mc = new MemCachedStrategy();
         return(mc.RetrieveObject(key));
     }
     catch
     {
         return(null);
     }
 }
Beispiel #5
0
        protected void DeleteDepend(string key)
        {
            MemCachedStrategy mc = new MemCachedStrategy();

            mc.RemoveObject(key);
        }
Beispiel #6
0
        /// <summary>
        /// 刷新缓存
        /// </summary>
        protected void FlushDependkey()
        {
            MemCachedStrategy mc = new MemCachedStrategy();

            mc.AddObject(dependkey, 1);
        }
Beispiel #7
0
        public object GetDepend(string key)
        {
            MemCachedStrategy mc = new MemCachedStrategy();

            return(mc.RetrieveObject(key));
        }