Exemple #1
0
 /// <summary>
 /// 设置缓存过期
 /// </summary>
 /// <param name="key"></param>
 /// <param name="datetime"></param>
 public static void SetExpire(string key, DateTime datetime)
 {
     using (NewLife.Caching.Redis redis = GetClient())
     {
         TimeSpan ts = datetime - DateTime.Now;
         redis.SetExpire(key, ts);
     }
 }