如何在ASP.NET中检查用户是否在线? [英] How to check in ASP.NET if the user is online?

查看:51
本文介绍了如何在ASP.NET中检查用户是否在线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此网站上次活动:此IP地址前1分钟"的背后逻辑是什么?如果要在隐藏字段中获取用户的IP地址,我该如何在vb.net中做到这一点?

what is the logic behind this on this website "last activity: 1 min ago from this ip address " If you are obtaining the user's IP address in a hidden field , how can I do this in vb.net ?

如何使用该应用程序检查有多少用户在线?

And how can I check how many users are online using the application ?

推荐答案

ASP.NET成员资格服务支持此功能.要获取特定用户的上次活动日期,请使用LastActivityDate 属性并指示用户是否在线,请使用 IsOnline 属性.另外,要获取在线用户数量,请使用GetNumberOfOnlineUsers .当然,ASP.NET成员资格服务不会保存最后一个IP地址,在这种情况下,您必须重写 SqlMembershipProvider 的某些行为.

The ASP.NET Membership service supports this feature. To get the particular user's last activity date, use LastActivityDate property and to indicate whether the user is online or not use IsOnline property. Also to get the number of online users, use GetNumberOfOnlineUsers. Of course, the ASP.NET Membership service does not save the last IP address, and you have to override some behavior of SqlMembershipProvider in this case.

这篇关于如何在ASP.NET中检查用户是否在线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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