[英]How to find how many users are browsing your webpage at the same time?
I need to find using asp.net,我需要找到使用 asp.net,
How many users are browsing my website at any particular instance of time.在任何特定时间有多少用户正在浏览我的网站。
How can I do that?我怎样才能做到这一点?
You could use an application variable and increment it during *Session_Start* in the Global.asax.您可以使用应用程序变量并在 Global.asax 中的 *Session_Start* 期间递增它。 Also this variable needs to be decremented when the *Session_End* event is fired.
当 *Session_End* 事件被触发时,这个变量也需要递减。
If you are using the ASP.NET Membership Provider - Membership.GetNumberOfUsersOnline()如果您使用的是 ASP.NET 会员提供程序 - Membership.GetNumberOfUsersOnline()
Or you could try one of the ASP.NET performance counters .或者您可以尝试ASP.NET 性能计数器之一。 State Server Sessions Active The number of currently active user sessions.
State 活动服务器会话数当前活动的用户会话数。 This counter is available only on the computer where the state server service (as.net_state) is running.
此计数器仅在运行 state 服务器服务 (as.net_state) 的计算机上可用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.