Код: Выделить всё
dynamic a = HttpContext;
Dictionary userDic = this.HttpContext.Application["UserSessionList"] as Dictionary;
if (userDic != null)
{
if (useDic.ContainsKey(authUser.UserId))
{
userDic.Remove(authUser.UserId);
}
}
else
{
userDic = new Dictionary();
}
userDic.Add(authUser.UserId, a.Session.SessionID.ToString());
this.HttpContext.Application["UserDic"] = userDic;
Код: Выделить всё
userDic.AddOrUpdate(authUser.UserId,
a.Session.SessionID.ToString(),
/*** what to add here? ***/);
Подробнее здесь: https://stackoverflow.com/questions/702 ... ddorupdate
Мобильная версия