Click here to Skip to main content
16,018,949 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to find how many user in online in one server

OP Edit:I'm asking i have to find out of my server online users detail

Edit: Added OP reply as an update to the question.
Posted
Updated 11-Jan-11 0:46am
v2
Comments
Dylan Morley 11-Jan-11 6:35am    
Please expand on your question.

When you say server, how many people using an Asp.Net application? e.g 'there are 23,500 members currently online' Are you using a database to store users online?

Or how many people logged on to terminal services \ thin client?

Try enumerating the users on the server
Howto: (Almost) Everything In Active Directory via C#[^]

Then check their logins ... some info on that here:
http://dmitrysotnikov.wordpress.com/2008/07/18/finding-the-latest-logon-time/[^]

Regards
Espen Harlinn
 
Share this answer
 
v2
1. Create an application object say SessionCount.
2. Handle session's OnStart and OnEnd method.
3. In Onstart, add one to SessionCount application object.
4. In OnEnd, reduce one from it.

This way you will not need to poll the database everytime.

This may not work if you have more than one web servers where site is hosted and objects are stored in-memory. In this case database polling the solution.
 
Share this answer
 
v2
Comments
Dalek Dave 11-Jan-11 6:43am    
That's a great answer!
Venkatesh Mookkan 11-Jan-11 7:03am    
Did you mean OnSessionStart?
dan!sh 11-Jan-11 8:16am    
@Venkatesh: yes.
That is I think a way only to take a look into database.

I suppose that you're storing or keeping a bool of IsLoggedIn for user ? :~
Count all active that is number of users online in your case.

Or Spend some more time on asking question to get well response by members.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900