Пример #1
0
        /// <summary>
        /// 获取一个key数据
        /// </summary>
        /// <param name="strKey">key</param>
        /// <returns>泛型数据</returns>
        public static YDS6000.Models.RstVar GetVal(string strKey)
        {
            string val = YDS6000.Models.ProcessSevice.Client(WebConfig.Port).GetCollectVal(strKey);

            if (string.IsNullOrEmpty(val))
            {
                return(null);
            }
            YDS6000.Models.RstVar rstVar = YDS6000.Models.JsonHelper.Deserialize <YDS6000.Models.RstVar>(val);
            return(rstVar);
        }
Пример #2
0
 public static bool SetVal(string strKey, RstVar objValue, int validTime = 0)
 {
     if (validTime == 0)
     {
         return(redisHelper.Item_Set(strKey, objValue, lNumofMilliSeconds));
     }
     else
     {
         return(redisHelper.Item_Set(strKey, objValue, validTime));
     }
 }
Пример #3
0
 public static bool SetVal(string strKey, RstVar objValue)
 {
     if (lNumofMilliSeconds == 0)
     {
         return(DistCache.Add(strKey, JsonHelper.Serialize(objValue)));
     }
     else
     {
         return(DistCache.Add(strKey, JsonHelper.Serialize(objValue), lNumofMilliSeconds));
     }
     //return DistCache.Add(strKey, JsonHelper.Serialize(objValue));
 }