Hi all. My problem is i want to count the person online(include user and guest) on my website and how many user is online or something like this.
Give me some article or source to do it fine,please!! Hope reply soon.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Hemant KumarRank #1,202 · 1.5K reputationPosted Oct 20, 2011, 5:53 AM EDT
Hemant KumarRank #1,202 · 1.5K reputationPosted Oct 17, 2011, 8:10 PM EDT
public static int count = 0; void Application_Start(object sender, EventArgs e) { Application["myCount"] = count; } void Session_Start(object sender, EventArgs e) { count = Convert.ToInt32(Application["myCount"]); Application["myCount"] = count + 1; }viet vo quoc114 reputationPosted Oct 18, 2011, 5:50 PM EDT
Thanks for help.But i have a problem want to ask you that If i want to store the persons who visited in my site ,i have to create a table in database and when session_start was changed i must connect to my database and update it.IF there is much person access i must connect to database much times ,so my website is slower.Is there any way to make it better???Hope reply.
Hemant KumarRank #1,202 · 1.5K reputationPosted Oct 18, 2011, 10:45 PM EDT
As if i consider it is better to save the registered users visit record only.Not the unknown user data also.This is will increase your application performance.It is waste of saving the unknown user info also.just try to maintain the Visitor count only.
Mark as "Accepted Answer" if it helps you .
viet vo quoc114 reputationPosted Oct 19, 2011, 5:03 AM EDT