更改空闲用户状态 [英] Change idle users status

查看:108
本文介绍了更改空闲用户状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.net应用程序,用户可以与在线用户聊天。这里没有实现成员资格,当用户登录时我们将状态设置为在线。

问题是如果用户长时间闲置或者他们关闭浏览器我们需要更改其状态。 />
我们怎么能这样做?

I have an ASP.net application where users can chat with online users. There is no membership implemented here, when user log in we set the status as online.
The problem is if user's are idle since long time or they close their browser we need to change their status.
How can we don that?

推荐答案

基本上是浏览器和服务器中打开的页面之间唯一的'连接',服务它是会话在服务器和一些内部浏览器管理的id能够重新连接到该会话...服务器上的那个会话有一个寿命(在IIS中默认为20分钟),它将以event - Session_End - 在你的global.asax中......

https://msdn.microsoft.com/en-us/library/ms178583%28v=vs.140%29.aspx [ ^ ]

将状态设置为离线在那个事件可能会给你一个解决方案......
Basically the only 'connection' between an open page in the browser and server, served it is the session at the server and some id the browser manages internally to be able to re-connect to that session...That session at the server there is a life-span (20 minutes by default in IIS) that will comes to and end with an event - Session_End - in your global.asax...
https://msdn.microsoft.com/en-us/library/ms178583%28v=vs.140%29.aspx[^]
Setting the status to offline at that event may give you a solution...


这篇关于更改空闲用户状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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