如何使用凭据来自数据库的C#或VB.Net WinForms处理用户登录? [英] How to handle user log-in using C# or VB.Net WinForms wherein credentials are from the database?

查看:111
本文介绍了如何使用凭据来自数据库的C#或VB.Net WinForms处理用户登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CodeProject朋友的美好时光

我再次遇到另一个问题,我正在考虑如何处理WinForms应用程序中的登录.例如,我有一个登录表单,要求用户输入存储在数据库中的用户名和密码(我已经完成了这一部分).

现在,当我尝试在两台不同的PC或工作站上使用同一帐户登录时,两台计算机都可以使用同一帐户进行访问.有什么方法可以防止这种情况发生吗? WinForms应用程序中是否有这样的登录控件?

Good day CodeProject fella''s

I am here again with another question, I am thinking of how to handle log-in in a WinForms application. For example I have a log-in form which requires the user to input the username and password that is stored in a database (I have done this part).

Now here''s the thing, when I tried to log-in using the same account on two different PC''s or workstation, both computers can access with the same account. Is there a way on how I can prevent this thing? Are there such log-in controls when it comes to WinForms applications?

Please do help me guys, thanks a lot!

推荐答案

您可以在数据库中维护登录详细信息,以通过客户端的IP地址跟踪用户的登录,并且重新登录时匹配它并进行相应处理.
You can maintain login detail in database to keep track of user''s login by maintaing IP of client,and on relogin match it and deal accordingly.


这篇关于如何使用凭据来自数据库的C#或VB.Net WinForms处理用户登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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