开发者

How to see how many online users are on my ASP.Net MVC3 website?

开发者 https://www.devze.com 2023-04-05 08:50 出处:网络
What\'s the easiest way to see how many users are currently online on my website? I\'d like to display and set this information inside of my _Layout.cshtml file.

What's the easiest way to see how many users are currently online on my website?

I'd like to display and set this information inside of my _Layout.cshtml file.

I'm using the latest version of ASP.Net MVC3 along wi开发者_如何学运维th C#.


Actually it can be handled in the same way as in ASP.NET.

Main scenario is to increment some static variable or variable in Application[] collection on Session_Start and decrease this value on Session_End to handle number of online users.


Application state can be used in this case. Hold a global variable which increments on each new session and decreases on session expiry

0

精彩评论

暂无评论...
验证码 换一张
取 消