在线计算用户不正确 [英] Count user online incorrect

查看:80
本文介绍了在线计算用户不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

使用Frame时我无法正确计算用户在线数,在线用户数增加了很多。这是我的代码:

Hi all,
I cannot count user online correctly when using Frame, the number of user online is increase very large amount. Here is my code:

void Session_Start(object sender, EventArgs e)
{
    Application.Lock();
    Application["CurrentUsers"] = (int)Application["CurrentUsers"] + 1;
    Application.UnLock();
}

void Session_End(object sender, EventArgs e)
{
    Application.Lock();
    if ((int)Application["CurrentUsers"] > 0)
    {
        Application["CurrentUsers"] = (int)Application["CurrentUsers"] - 1;
    }
    Application.UnLock();
}



虽然我使用母版页时它是正确的。



P / S;我的页面需要使用框架!


Although it's correct when I use master page.

P/S; My page need to use frame!

推荐答案

请参阅以下链接获取类似文章:

如何显示ASP.NET网站的在线用户/访问者数量? [ ^ ]

ASP.net - 计算在线访问者数量 [ ^ ]

在您的网站上显示当前用户数 [ ^ ]

ASP.NET中的在线活动用户计数器 [ ^ ]



- Amit
Refer the links below for similar articles:
How to show number of online users / visitors for ASP.NET website?[^]
ASP.net - Count Online Visitor[^]
Show current user count on your web site[^]
Online active users counter in ASP.NET[^]

--Amit


这篇关于在线计算用户不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆