c# - counting online number of users of a web application -


I use ASP.Net + .NET 3.5 + VS2008 + IIS 7.0 + C # to develop a web application I am I want to count how many users are online, this is my current implementation,

  1. When the session is called IStart, I will increase the number of online users from 1;
  2. When the session is called I_End, I will reduce the number of users online 1.

Two questions,

A. Is this implementation correct?

B. Another question is, I think this method can not track the users of real time, since the user closes the browser, session_ind will not be called immediately (session_ind will be adjourned). correct?

Are you using ASP.NET subscriptions?

  Subscription .GetNumberOfUsersOnline ()  

You can customize the amount of time when a user is "code"> "web.config is considered "online" - such as

  & lt; subscribe to the default provider = "..." userIsOnlineTimeWindow = "10" & lt; Provider & gt; .... & Lt; / provider & gt; & lt; / subscription & gt;  

read more


Comments