Пример #1
0
        /// <summary>
        /// after the user clicks the logout link and the logout process is complete
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void LoginStatus1_LoggedOut(object sender, EventArgs e)
        {
            MembershipUser user = Membership.GetUser();

            if (user != null)
            {
                SessionMannager.Remove_ActiveSession(user.UserName);
                //Dictionary<string, DateTime> activeUsers = (Dictionary<string, DateTime>)Application["activeUsers"];

                //if (activeUsers.ContainsKey(user.UserName))
                //{
                //    activeUsers.Remove(user.UserName);
                //}
            }
        }
Пример #2
0
        void Session_Start(object sender, EventArgs e)
        {
            //Si el usuario establecio recordar usuario y password en el browser.. se carga automaticamente el usuario
            MembershipUser user = Membership.GetUser();

            //if (user != null)
            //{
            //    Dictionary<string, DateTime> activeUsers = (Dictionary<string, DateTime>)Application["activeUsers"];

            //    if (!activeUsers.ContainsKey(user.UserName))
            //    {
            //        activeUsers.Add(user.UserName, System.DateTime.Now);
            //    }
            //}
            SessionMannager.Check_ActiveSession(user, this.Session.SessionID);
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Dictionary<string, DateTime> activeUsers = (Dictionary<string, DateTime>)Application["activeUsers"];

            StringBuilder str = new StringBuilder();

            //foreach (KeyValuePair<string, DateTime> u in activeUsers)
            //{
            //    str.AppendLine("<DIV>");
            //    str.AppendLine(string.Concat(u.Key, " inicio:  ", u.Value.ToString()));
            //    str.AppendLine("</DIV>");
            //}
            foreach (SessionHistory u in SessionMannager.Retrive_History())
            {
                str.AppendLine("<DIV>");
                str.AppendLine(string.Concat("User ", u.UserName, " ", u.Status, " at ", u.StatusDate.ToString()));
                str.AppendLine("</DIV>");
            }
            LIST = str.ToString();
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Dictionary<string, DateTime> activeUsers = (Dictionary<string, DateTime>)Application["activeUsers"];

            StringBuilder str = new StringBuilder();

            //foreach (KeyValuePair<string, DateTime> u in activeUsers)
            //{
            //    str.AppendLine("<DIV>");
            //    str.AppendLine(string.Concat(u.Key, " inicio:  ", u.Value.ToString()));
            //    str.AppendLine("</DIV>");
            //}
            List <ActiveSession> wSessions = SessionMannager.Retrive_ActiveSessions();

            foreach (ActiveSession u in wSessions)
            {
                str.AppendLine("<DIV>");
                str.AppendLine(string.Concat("User ", u.UserName, " inicio:  ", u.LoggedInDate.ToString()));
                str.AppendLine("</DIV>");
            }
            LIST = str.ToString();

            count = wSessions.Count().ToString();
        }