Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to Count Online Visitors in ASP.NET 2.0 ?

How to Count Online Visitors in ASP.NET 2.0 ?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    immori
    wrote on last edited by
    #1

    Hi I want to count my website online visitors . then I used these codes and set the < sessionState > element mode to "InProc" in web.config. but when a user exits from site the counter dosent decrease !!!! in fact the event Session_End doesnt raise!!!! plz help me! void Application_Start(object sender, EventArgs e) { Application["accesses"] = 0; Application["users"] = 0; } void Application_BeginRequest(Object sender, EventArgs e) { Application.Lock(); Application["accesses"] = (int)Application["accesses"] + 1; Application.UnLock(); } void Session_Start(object sender, EventArgs e) { Application.Lock(); Application["users"] = (int)Application["users"] + 1; Application.UnLock(); } void Session_End(object sender, EventArgs e) { Application.Lock(); Application["UsersOnline"] = (int)Application["UsersOnline"] - 1; Application.UnLock(); }

    T 1 Reply Last reply
    0
    • I immori

      Hi I want to count my website online visitors . then I used these codes and set the < sessionState > element mode to "InProc" in web.config. but when a user exits from site the counter dosent decrease !!!! in fact the event Session_End doesnt raise!!!! plz help me! void Application_Start(object sender, EventArgs e) { Application["accesses"] = 0; Application["users"] = 0; } void Application_BeginRequest(Object sender, EventArgs e) { Application.Lock(); Application["accesses"] = (int)Application["accesses"] + 1; Application.UnLock(); } void Session_Start(object sender, EventArgs e) { Application.Lock(); Application["users"] = (int)Application["users"] + 1; Application.UnLock(); } void Session_End(object sender, EventArgs e) { Application.Lock(); Application["UsersOnline"] = (int)Application["UsersOnline"] - 1; Application.UnLock(); }

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      Here is an article about detecting session timeouts. I hope it helps. http://aspalliance.com/520


      how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups