如何在asp.net中两次限制用户登录 [英] how to restrict user login twice in asp.net

查看:109
本文介绍了如何在asp.net中两次限制用户登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Web应用程序中限制用户两次登录

[edit]删除了虚假代码块-OriginalGriff [/edit]

how to restrict user login twice in an web application

[edit]Spurious code block removed - OriginalGriff[/edit]

推荐答案

您可以做一件事....
使用会话变量..
在登录时,将登录状态存储在变量中,并在每次页面加载时对其进行检查...
you can do one thing....
use session variable..
at login time store the login status in variable and check it on every page load...


使用他的帐户登录两次. MembershipUser类具有属性"IsOnline",该属性通过检查登录时间跨度来返回用户是否已登录.要可靠地执行操作并不容易,因为HTTP是断开连接的无状态协议,因此,如果当前日期和时间减去UserIsOnlineTimeWindow属性值早于该用户的LastActivityDate,则该用户将被视为在线用户
from login twice with his account. The MembershipUser class has a property "IsOnline " which returns wheter a user is logged in or not by checking the login time span. It''s not easy to do reliably because HTTP is a disconnected, stateless protocol, Therefore, a user is considered online if the current date and time minus the UserIsOnlineTimeWindow property value is earlier than the LastActivityDate for the user


这篇关于如何在asp.net中两次限制用户登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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