Messenger或Web聊天室 [英] Messenger Or Web Chat room

查看:94
本文介绍了Messenger或Web聊天室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何找到所有在线用户的.

像Code项目一样,它在在线用户的顶部显示no,但不是所有在线用户的朋友lsit显示

我如何在Asp.net中的会话中执行此操作以及解决此问题的其他建议.



提前Thnks

How i am find the lsit of all online user.

like Code project its show no of online user in top of the but not all online user friend lsit display

How i m doing this with session in Asp.net and other suggestion for solve this problem.



Thnks in advance

推荐答案

Global.asax 文件中编写与整个应用程序交互的代码.
示例代码如下:
Write code in Global.asax file which interacts with the entire application.
The sample code is given below:
void Application_OnStart(Object Sender, EventArgs E)
{
     Application["CurrentUsers"] = 0;
}
void Session_OnStart(object Sender, EventArgs E)
{
     Application.Lock();
     Application["CurrentUsers"] = System.Convert.ToInt32(Application["CurrentUsers"]) + 1;
     Application.UnLock();
}
void Session_OnEnd(object Sender, EventArgs E)
{
     Application.Lock();
     Application["CurrentUsers"] = System.Convert.ToInt32(Application["CurrentUsers"]) - 1;
     Application.UnLock();
}


如果您正在进行会话,那么您知道有人在线.您必须等待一段时间才能假定它们不是.然后,您可以算出他们的数量
If you have a session, then you know someone is online. You have to wait for a time out to assume they are not. You can then count them


如此出色的帮助,感谢我的帮助,我已经解决了很多时间,大声笑了
thanks for all for such a nice help i have solve my problem after a big time lol thnaks again


这篇关于Messenger或Web聊天室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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