Esref DURNA wrote:[color=blue]
> how I could count the number of online users with asp .net?
> which complement should i use?[/color]
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.
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" <news.2.hansdk@ spamgourmet.com > a écrit dans le message de
news:eiUfPQ7pEH A.536@TK2MSFTNG P11.phx.gbl...[color=blue]
> Esref DURNA wrote:[color=green]
> > how I could count the number of online users with asp .net?
> > which complement should i use?[/color]
>
> 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[/color]
left your site[color=blue]
> - 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
>
>[/color]
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" <Erik@discussio ns.microsoft.co m> a écrit dans le message de
news:B387A8F9-F816-49CA-BAF7-F3EC7F010342@mi crosoft.com...[color=blue]
> Can you tell me how I can read this performance counter?
> The global.asax way seems not to work on my server.
>
> "Patrice" wrote:
>[color=green]
> > Another option is to read the corresponding performance counter (and[/color][/color]
perhaps[color=blue][color=green]
> > cache the value as there is probably no need to have alwxays the exact
> > value)...
> >
> > Patrice
> >
> > --
> >
> > "Hans Kesting" <news.2.hansdk@ spamgourmet.com > a écrit dans le message[/color][/color]
de[color=blue][color=green]
> > news:eiUfPQ7pEH A.536@TK2MSFTNG P11.phx.gbl...[color=darkred]
> > > 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[/color][/color][/color]
has[color=blue][color=green]
> > left your site[color=darkred]
> > > - I read somewhere (can't remember the link - can someone confirm?)
> > > that Session_OnEnd is not called if nothing was stored in the[/color][/color][/color]
session.[color=blue][color=green][color=darkred]
> > >
> > > Hans Kesting
> > >
> > >[/color]
> >
> >
> >[/color][/color]
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.
Comment