Exemplo n.º 1
0
        /// <summary>
        /// 根据Key获取前台配置
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string GetSysConfigByKey(string key)
        {
            string cacheKey = "GetSysConfigByKey" + key;

            if (HttpRuntime.Cache[cacheKey] != null)
            {
                return((string)HttpRuntime.Cache[cacheKey]);
            }
            string value = CommonDA.GetSysConfigByKey(key);

            if (!string.IsNullOrWhiteSpace(value))
            {
                HttpRuntime.Cache.Insert(cacheKey, value, null, DateTime.Now.AddSeconds(CacheTime.Longest), Cache.NoSlidingExpiration);
            }
            return(value);
        }