void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started ++Users.OnlineCounter; ++Users.TotalUsers; } void Session_End(object sender, EventArgs e) { --Users.OnlineCounter; }
public class Users { public Users() { // // TODO: Add constructor logic here // } private static int onlineCounter; private static int totalUsers; public static int TotalUsers { get { return Users.totalUsers; } set { Users.totalUsers = value; } } public static int OnlineCounter { get { return Users.onlineCounter; } set { Users.onlineCounter = value; } } }
Application
Application["onlineUsers"]
Application["TotalVisisted"]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)