ASP.NET - How to track no. of users in c# application

Asked By on 16-Apr-10 05:28 AM
Hi All

I have developed a web application and upload in the server.we want that when any user open my site then counting of member
will increase.we want count total visit day by day if any one open my site ...
please provide some source code of help me

samjayander thiagarajan replied to on 16-Apr-10 06:06 AM

You can use the session_start and session_end events in the global.asax file to count the number of users.

Here is how you can do that:
void Session_Start(object sender, EventArgs e)
    Application["ActiveUsers"] = (int)Application["ActiveUsers"] + 1;
void Session_End(object sender, EventArgs e)
    Application["ActiveUsers"] = (int)Application["ActiveUsers"] - 1;

Super Man replied to on 16-Apr-10 08:35 AM

there are some website that provides you log of currently login users, today total visit, last day visit.

from which country users are online,

just go through the google.

you have to just add script in your site.thats it

Goniey N (Mr. G) replied to on 16-Apr-10 08:59 AM
For That You Can Take One Table For Storing The Data of Visitors.

When User Will Open your Main Page At That Time On The Page Load Event Retrieve The Last Visitor Number From The Table & Store It In Temporary Variable & The Increment It By One And Then Again Incremented Visitor Number In to Your Table.

That's Way You Can Solve your Problem..

//I Hope This Will Clear You & It Will Work 100%.....