Re: Users Counter

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Kenny M. (KennyM_at_discussions.microsoft.com)
Date: 01/13/05


Date: Thu, 13 Jan 2005 05:55:04 -0800

using that code I got the message:

"Sólo se pueden utilizar las expresiones de objeto assignment, call,
increment, decrement y new como instrucción"

"Do Quyet Tien" wrote:

> Why not code:
>
> Application.Lock();
> 1 + (int)Application["NumVisitors"];
> Application.UnLock();
>
> instead of:
>
> Application.Lock();
> Application["NumVisitors"] =
> int.Parse(Application["NumVisitors"].ToString()) + 1;
> Application.UnLock();
>
>
> "Kenny M." <KennyM@discussions.microsoft.com> wrote in message
> news:D012A6DE-3CF9-48A7-A7D0-D578CD7FB9DB@microsoft.com...
> > I want to control how many users there are login in my app
> >
> > I have the following code on Session_Start
> >
> > Application.Lock();
> > Application["NumVisitors"] =
> > int.Parse(Application["NumVisitors"].ToString()) + 1;
> > Application.UnLock();
> >
> > and Session_End
> >
> > Application.Lock();
> > Application["NumVisitors"] =
> > int.Parse(Application["NumVisitors"].ToString()) - 1;
> > Application.UnLock();
> >
> > I dont have a SignOut button on my App because users never press it, they
> > just go away or close the browser
> >
> > the conclusion The sessions are not being closed, actually en Debug mode I
> > never see the Session_End Event came up.
> >
> > Any idea or Link Where Can I Start?
> >
> > ken
> >
> > --
> > Kenny M.
>
>
>



Relevant Pages

  • Re: already running
    ... network. ... I guess the app can increment a number in a file in its app.path when the ... app starts and decrement it when it shuts down... ...
    (microsoft.public.vb.general.discussion)
  • Re: Excel Application Process Does Not Die (my problem solved)
    ... where there is no automatic decrement of a reference count upon ... reference COM components are set to null, then call a the static Collect ... > I have noticed a bunch of posts regarding the use of the Excel COM object> regarding the Excel process never dies. ... > My app is a console app that loops a list of clients and creates and saves> some excel docs. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Firefox and Page Events
    ... In my app I have code to increment a counter and write an event each ... As a result, my counters are wrong, and my event log is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Firefox and Page Events
    ... In my app I have code to increment a counter and write an event each ... As a result, my counters are wrong, and my event log is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Version auto-increment issue
    ... I cannot seem to get the version number of my VB app to increment ... Is there a way to force the framework to recalculate ...
    (microsoft.public.dotnet.languages.csharp)