ASP.NET MVC在线人数统计

2021-06-19 21:04

阅读:592

标签:star   session   tar   glob   obj   lob   code   lock   event   

 

 

protected void Application_Start()
{
Application["OnLineUserCount"] = 0;
AreaRegistration.RegisterAllAreas();

RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}

protected void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application["OnLineUserCount"] = Convert.ToInt32(Application["OnLineUserCount"]) + 1;
Application.UnLock();
}

protected void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application["OnLineUserCount"] = Convert.ToInt32(Application["OnLineUserCount"]) - 1;
Application.UnLock();
}

 

ASP.NET MVC在线人数统计

标签:star   session   tar   glob   obj   lob   code   lock   event   

原文地址:http://www.cnblogs.com/sharing1986687846/p/7191422.html


评论


亲,登录后才可以留言!