asp.net中的登录问题 [英] login problem in asp.net

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

问题描述

我正在开发一个软件,在三个用户身份验证,但我希望第一个管理员登录然后另一个用户登录,如果管理员没有登录,那么没有人可以登录

解决方案

< blockquote>

您需要在数据库中设置标志AccountStatus(0,1,其中0表示已停用的帐户,1表示帐户已激活)。最初对于admin应该是1,对于其他用户,它应该是0。



在登录时,您需要检查AccountStatus字段值,如果AccountStatus 是1然后只有用户才能登录。



管理员登录后,您可以通过运行更新查询将其他用户的AccountStatus标志更新为1在成功消息之后或下一页完全加载之前,或者您可以选择管理员激活所选用户的帐户。



现在它取决于你,你的方式想做。



我希望这能解决你的问题。



谢谢

您好

您必须在一个表中捕获登录用户,一旦用户或管理员登录,您必须插入用户名及其身份验证。



如果管理员登录你必须捕获名称及其身份验证类型,一旦管理员注销你删除该表的管理员条目表。



所以最后除了管理员如果登录,首先检查管理员是否记录使用该表,如果管理员已经登录然后允许其他用户,如果没有则显示消息管理员不登录。



但是为什么你想要第一个管理员需要登录,然后其他用户允许登录?

如果管理员在某些天离开,那么没有人(管理员用户除外)无法登录,



这是你想要的吗?


i am developing a software in that three users authentication but i want that first admin logged in then another user logged if admin not logged then no one can logged in

解决方案

you need to set the flag say "AccountStatus" (0, 1 where 0 represents the deactivated account and 1 represents the account is activated) in database. initially for admin it should be 1 and for other users it should be 0.


At the time of login you need for check the "AccountStatus" field value, If "AccountStatus" is 1 then only user can able to login.


Once the admin logs in, you can update the "AccountStatus" flag for other users to 1 by running the update query just after the success message or before the next page loads completely or you can give the option to admin to activate the selected user's account.


Now its upto you, which way you want to do.


I hope this will solve your problem.


Thanks


Hi
U have to capture login user in one table,once user or admin login u have to insert user name and its authentication.

If admin login u have to capture name and its authentication type,once admin logout u delete admin entry form that table.


So finally other than admin if login ,first check admin is logged or not using that table,if admin already logged in then allow other user,if not then show message admin not login.


But why u want first admin need to login and then other user allow to login ?
If admin leave on some days,then nobody(other than admin users) cant login,


Is this u want ?


这篇关于asp.net中的登录问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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