在具有相同用户名的服务器中登录时出现问题. [英] Problem with Login in Server with Same Username.

查看:75
本文介绍了在具有相同用户名的服务器中登录时出现问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的专家!

正在使用ASP.Net,C#和SQLServer2005.

我创建了一个Web应用程序,并最终将其托管在IIS服务器中.

在服务器上托管后,我可以使用相同的用户名和密码从不同的系统登录.

那么如何避免这些登录....来自其他系统的一个用户名和密码.

假设我从一个系统登录,并且使用相同的用户名和密码.它必须显示一条消息....已经使用该用户名登录.


注意:如果其他用户已经使用相同的用户名/密码登录,则不能使用同一用户登录.

请帮我解决这个问题.

感谢

Dear Experts !!

Am working on ASP.Net , C#, SQLServer 2005.

I have Created a Web Application, and Finally Hosted in IIS Server.

After hosting in server,I can Login with Same Username and Password from Different systems.

So how to avoid these login.... one username and password from other systems.

Suppose if i login from one System and if i use these same username and password. it must show a message that....already login with this username.


Note : No Same User should login.....if the other user already login with same username/password.

Please help me this problem.

Thanks

推荐答案

基本上,您必须在数据库中保存一个标记为用户已登录"的标志,并在同一用户再次尝试时检查该标志,然后拒绝它.

最好为此设置一个超时时间(这样,您的用户可以在闲置半小时后再次登录),这样,即使发生电源故障或类似情况也不会使您的用户永久无法进入.

确切的信息由您决定-我们对您使用的登录系统一无所知!
Basically, you have to save a flag in your database that says "user logged in" and check it when the same user tries again, and refuse it.

It would be a good idea to put a timeout on this (so that your user can log in again after he has been idle for half an hour say) so that a power failure or similar does not leave you user permanently unable to get in.

The exact details are up to you - we do not know anything about what login system you are using!


hi Ranjith,

您可以在logindetail表中添加一个字段,用于保存loginid和密码,该字段为IsLogin布尔类型.

默认情况下,此字段应为false.当用户登录时,此字段将更新为true.
每次登录时检查是否为true或false(如果为true则表示用户已经登录).
hi Ranjith,

you can add one more field in logindetail table where you save loginid and password,field is IsLogin boolean type.

this field should false default.when user login this field is updated to true.
on every login check is true or false if true that means user already login.


这篇关于在具有相同用户名的服务器中登录时出现问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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