Hi,
How can we get tthe number of active users connected to our web application.
I have added application varible that gets incrimeted at session_start and then is decreased at session_end
void Session_Start(o bject sender, EventArgs e)
{
// Code that runs when a new session is started
Application.Loc k();
Application["TotalUsers "] = Convert.ToInt32 ( Application["TotalUsers "].ToString()) + 1;
Application.UnL ock();
}
void Session_End(obj ect sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
Application.Loc k();
Application["TotalUsers "] = Convert.ToInt32 (Application["TotalUsers "].ToString()) - 1;
Application.UnL ock();
}
but the count keeps on increasing ...
i get the total users but not the total ACTIVE USERS
thanks
How can we get tthe number of active users connected to our web application.
I have added application varible that gets incrimeted at session_start and then is decreased at session_end
void Session_Start(o bject sender, EventArgs e)
{
// Code that runs when a new session is started
Application.Loc k();
Application["TotalUsers "] = Convert.ToInt32 ( Application["TotalUsers "].ToString()) + 1;
Application.UnL ock();
}
void Session_End(obj ect sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
Application.Loc k();
Application["TotalUsers "] = Convert.ToInt32 (Application["TotalUsers "].ToString()) - 1;
Application.UnL ock();
}
but the count keeps on increasing ...
i get the total users but not the total ACTIVE USERS
thanks
Comment