473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

number of online users?

how I could count the number of online users with asp .net?
which complement should i use?
Nov 18 '05 #1
6 2075
Esref DURNA wrote:
how I could count the number of online users with asp .net?
which complement should i use?


Probably something like this:
- have a counter in the Application object
- on Session start increment the counter
- on Session end decrement it

This should count all active sessions, but there are some warnings:
- a session is counted until it ends, which is 20 min. after the user has left your site
- I read somewhere (can't remember the link - can someone confirm?)
that Session_OnEnd is not called if nothing was stored in the session.

Hans Kesting
Nov 18 '05 #2
Another option is to read the corresponding performance counter (and perhaps
cache the value as there is probably no need to have alwxays the exact
value)...

Patrice

--

"Hans Kesting" <ne***********@spamgourmet.com> a écrit dans le message de
news:ei*************@TK2MSFTNGP11.phx.gbl...
Esref DURNA wrote:
how I could count the number of online users with asp .net?
which complement should i use?
Probably something like this:
- have a counter in the Application object
- on Session start increment the counter
- on Session end decrement it

This should count all active sessions, but there are some warnings:
- a session is counted until it ends, which is 20 min. after the user has

left your site - I read somewhere (can't remember the link - can someone confirm?)
that Session_OnEnd is not called if nothing was stored in the session.

Hans Kesting

Nov 18 '05 #3
Can you tell me how I can read this performance counter?
The global.asax way seems not to work on my server.

"Patrice" wrote:
Another option is to read the corresponding performance counter (and perhaps
cache the value as there is probably no need to have alwxays the exact
value)...

Patrice

--

"Hans Kesting" <ne***********@spamgourmet.com> a écrit dans le message de
news:ei*************@TK2MSFTNGP11.phx.gbl...
Esref DURNA wrote:
how I could count the number of online users with asp .net?
which complement should i use?


Probably something like this:
- have a counter in the Application object
- on Session start increment the counter
- on Session end decrement it

This should count all active sessions, but there are some warnings:
- a session is counted until it ends, which is 20 min. after the user has

left your site
- I read somewhere (can't remember the link - can someone confirm?)
that Session_OnEnd is not called if nothing was stored in the session.

Hans Kesting


Nov 18 '05 #4
Try :
http://aspnet.4guysfromrolla.com/articles/041002-1.aspx

You could also impersonate by code just the time needed to get the counter.
Also you way want to "cache" this value if you don't need the real value at
any one time (is it for admin purpose or to display this to users ?).

Patrice

--

"Erik" <Er**@discussions.microsoft.com> a écrit dans le message de
news:B3**********************************@microsof t.com...
Can you tell me how I can read this performance counter?
The global.asax way seems not to work on my server.

"Patrice" wrote:
Another option is to read the corresponding performance counter (and perhaps cache the value as there is probably no need to have alwxays the exact
value)...

Patrice

--

"Hans Kesting" <ne***********@spamgourmet.com> a écrit dans le message de news:ei*************@TK2MSFTNGP11.phx.gbl...
Esref DURNA wrote:
> how I could count the number of online users with asp .net?
> which complement should i use?

Probably something like this:
- have a counter in the Application object
- on Session start increment the counter
- on Session end decrement it

This should count all active sessions, but there are some warnings:
- a session is counted until it ends, which is 20 min. after the user has
left your site
- I read somewhere (can't remember the link - can someone confirm?)
that Session_OnEnd is not called if nothing was stored in the

session.
Hans Kesting


Nov 18 '05 #5
This is for display purpose so a kind of accurate number would be best.

"Patrice" wrote:
Try :
http://aspnet.4guysfromrolla.com/articles/041002-1.aspx

You could also impersonate by code just the time needed to get the counter.
Also you way want to "cache" this value if you don't need the real value at
any one time (is it for admin purpose or to display this to users ?).

Patrice

--

"Erik" <Er**@discussions.microsoft.com> a écrit dans le message de
news:B3**********************************@microsof t.com...
Can you tell me how I can read this performance counter?
The global.asax way seems not to work on my server.

"Patrice" wrote:
Another option is to read the corresponding performance counter (and perhaps cache the value as there is probably no need to have alwxays the exact
value)...

Patrice

--

"Hans Kesting" <ne***********@spamgourmet.com> a écrit dans le message de news:ei*************@TK2MSFTNGP11.phx.gbl...
> Esref DURNA wrote:
> > how I could count the number of online users with asp .net?
> > which complement should i use?
>
> Probably something like this:
> - have a counter in the Application object
> - on Session start increment the counter
> - on Session end decrement it
>
> This should count all active sessions, but there are some warnings:
> - a session is counted until it ends, which is 20 min. after the user has left your site
> - I read somewhere (can't remember the link - can someone confirm?)
> that Session_OnEnd is not called if nothing was stored in the session. >
> Hans Kesting
>
>


Nov 18 '05 #6
By the way I am using C# and the global.asax is VBScript. could this be the
problem why this is not working?
If I use the same code in VB on my page than it does work.

"Patrice" wrote:
Try :
http://aspnet.4guysfromrolla.com/articles/041002-1.aspx

You could also impersonate by code just the time needed to get the counter.
Also you way want to "cache" this value if you don't need the real value at
any one time (is it for admin purpose or to display this to users ?).

Patrice

--

"Erik" <Er**@discussions.microsoft.com> a écrit dans le message de
news:B3**********************************@microsof t.com...
Can you tell me how I can read this performance counter?
The global.asax way seems not to work on my server.

"Patrice" wrote:
Another option is to read the corresponding performance counter (and perhaps cache the value as there is probably no need to have alwxays the exact
value)...

Patrice

--

"Hans Kesting" <ne***********@spamgourmet.com> a écrit dans le message de news:ei*************@TK2MSFTNGP11.phx.gbl...
> Esref DURNA wrote:
> > how I could count the number of online users with asp .net?
> > which complement should i use?
>
> Probably something like this:
> - have a counter in the Application object
> - on Session start increment the counter
> - on Session end decrement it
>
> This should count all active sessions, but there are some warnings:
> - a session is counted until it ends, which is 20 min. after the user has left your site
> - I read somewhere (can't remember the link - can someone confirm?)
> that Session_OnEnd is not called if nothing was stored in the session. >
> Hans Kesting
>
>


Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim Morrison | last post by:
SQL Server 2000 - MSDE 2000 Is there a way to get the number of current users logged into a SQL 2000 Server (also MSDE)? Cant be distinct users as most users are logged into the database using the...
29
by: Paul | last post by:
Hi, I'd like to limit the number of selections a user can make in a multiple select listbox. I have a note on the interface to say that only x no. of items should be selected and I check the...
6
by: Sal | last post by:
I want to sale my Access 2002 program and charge per number of computers using it on the network.This is front/back end database. How can I limit maximum number of users and change it base on some...
11
by: Ken Varn | last post by:
I want to be able to determine my current line, file, and function in my C# application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___ macros for getting this, but I cannot find a...
5
by: Kamaluokeakua | last post by:
I have to write an application that deals with clients in multiple countries. The addresses, phone numbers, country id and currency information has to be stored into a database that allows for the...
1
by: tranky | last post by:
hi, only one information,please... how to count number of anonymous online users? I use ASP.NET 2.0 thank u tranky
3
by: dream2rule | last post by:
Hello All, I have a table where i am maintaining the users' ip address and the date when they are accessing the website. so its like i have 3 fields in the table like ip_id - auto_increment...
21
by: Breana | last post by:
Ok, i am adding a table to the users table called online. So when they login it will set (online) to Y and when they logout it will be set to N. But what should it be created as, it will be...
2
by: kai | last post by:
Hi, I use VB 2008 as front end, SQL Server 2005/2008 as back end, I want control number of cucurrent users log on to the database, I am trying to use a stored procedure, but it did not work. Is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.