Hi Lenn,
You can take a look to the Session_OnStart and Session_OnEnd of the
global.asax. The problem is that you can count all the started sessions, but
is very difficult to tell which of them are active. In order to have a better
idea of this, you can also hook to the BeginRequest event and check when the
last request of a given section happened. Within this you can get an
aproximate measure of the amount of users using your site (you can know
exactly the number of sessions started, but some of them may be abandoned or
inactive, waiting for its timeout, e.g the client closed the browser).
Anyway, is very difficult to be deterministic about this issue, specially
because the inherent statefullness of http, but with this techinques you can
get an approximate value (with an error margin). Another sugestion would be
to make some calculations and have a "safe-guard" number of sessions, which
will allow you to deal with the unused but active sessions.
Here you can find some info about global.asax...
http://msdn.microsoft.com/library/de...alasaxfile.asp http://samples.gotdotnet.com/quickst...lobalasax.aspx
Regards,
Leon
"Lenn" wrote:
Hello,
This requirement might seem strange to someone out there, but here it's
We need to make sure only certain number of users can be logged in the site
at the same time. Is there any way to do that in ASP.NET, in web config file
or otherwise. Thanks in advance for your help.