验证用户是否可以在Windows窗体上进行多次登录 [英] Validate user against multi login on windows forms

查看:93
本文介绍了验证用户是否可以在Windows窗体上进行多次登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要有关如何确保用户不会两次登录的帮助,在将用户两次注册到数据库之前,应该在界面后面的C#代码上进行验证.谢谢

I need help on how to go about making sure a user does not log in twice, the validation should be on the C#-code behind interface before registering the user twice in the database. Thanks

推荐答案

Seundaniel,
有多种方法可以阻止用户进行多登录,而与Windows或登录存储的按钮单击事件上的Forms身份验证无关,用户ID
对于网络->使用缓存,会话变量
对于Windows/Web,您可以在用户登录后立即将其写入注册表,然后当用户再次尝试登录hutton时,将检查事件注册表值,并显示相应的消息已登录...!".可以显示
Hi Seundaniel,
There are many ways you can prevent the user from multilogin, irrespective of Windows or Forms authentication on button click event of the login store the UserID
For Web --> Use Cache, Session variables
For Windows / Web you can write user to registry as soon as he logsin , and when again user try to login in the hutton click event registry value will be checked and appropriate message "Already Logged In ...!" can be displayed


您可以检查数据库以查看用户是否已经在其他地方"登录,然后向他们显示一个对话框,如下所示:

您已经登录.如果您在此处登录,则任何其他当前活动的会话都将终止.要继续吗?"
You could check the database to see if the user is already logged on "somewhere else", and then present them with a dialog box that says something like this:

"You''re already logged on. If you login here, any other currently active session to be terminated. Continue?"


这篇关于验证用户是否可以在Windows窗体上进行多次登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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