Ejemplo n.º 1
0
        private static string GetCache(string key)
        {
            var md5Key      = SSSecurity.GetMD5(key);
            var cacheResult = MCache[md5Key];

            return(cacheResult != null?cacheResult.ToString() : null);
        }
Ejemplo n.º 2
0
        private static void SaveCache(string key, string value, int cacheDay)
        {
            var md5Key      = SSSecurity.GetMD5(key);
            var cacheResult = MCache[md5Key];

            if (cacheResult != null)
            {
                MCache.Remove(md5Key);
            }
            MCache.Add(md5Key, value, DateTime.Now.AddDays(cacheDay));
        }