ASP.NET MVC在线人数统计

在Global.asax.cs文件中代码:

protected void Application_Start()
{
Application["OnLineUserCount"] = ;
AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
} protected void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application["OnLineUserCount"] = Convert.ToInt32(Application["OnLineUserCount"]) + ;
Application.UnLock();
} protected void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application["OnLineUserCount"] = Convert.ToInt32(Application["OnLineUserCount"]) - ;
Application.UnLock();
}
上一篇:20155223 Exp2 后门原理与实践


下一篇:Oracle 给表添加主键和使ID自增、触发器、创建结构一样的表