Пример #1
0
 /// <summary>
 /// 在线用户SessionId列表
 /// </summary>
 /// <returns></returns>
 public IList <string> GetKeyAll()
 {
     return(RedisHash.SearchKeys("session_" + "*"));
 }
Пример #2
0
 /// <summary>
 /// 用户数量
 /// </summary>
 /// <returns></returns>
 public int Count()
 {
     return(RedisHash.SearchKeys("session_" + "*").Count);
 }
Пример #3
0
 /// <summary>
 /// 删除session
 /// 7.25 zl
 /// </summary>
 /// <returns></returns>
 public static bool ClearKey(string sessionId)
 {
     return(RedisHash.Remove(sessionId));//删除该hash键
 }
Пример #4
0
 /// <summary>
 /// 判断指定的用户是否存在(通过userid,即cookieKey)是否存在
 /// </summary>
 /// <param name="CookieKey">用户的userID</param>
 /// <returns>存在true,不存在false</returns>
 public bool ContainsKey(string CookieKey)
 {
     return(RedisHash.ContainsKey(CookieKey));
 }
Пример #5
0
 /// <summary>
 /// 清空Sesion
 /// </summary>
 public bool Clear()
 {
     return(RedisHash.Remove(SessionId));//删除该hash键
 }