如何在登录表单中使用“记住我"复选框? [英] how to use remember me checkbox in a login form?

查看:76
本文介绍了如何在登录表单中使用“记住我"复选框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

早安,

我是Debapriya,我在asp.net 2.0中开发了一个Web应用程序.在登录表单中,我使用2个文本框(用户ID,密码),2个按钮(登录,重置)和1个复选框(记住我).如何使用C#代码中的记住我"复选框?

谢谢

Debapriya

Dear,

Good morning,

I am Debapriya and I develop a web application in asp.net 2.0. In a login form I use 2 textboxes(User id,password), 2 buttons(login,reset) and 1 checkbox(remember me). How to use remember me checkbox in c# code?

Thank you,

Debapriya

推荐答案



我不会给您代码,但会提供一些建议.您应该将checbox标志与用户名/密码一起存储在某些配置文件或数据库中.这意味着,一旦选中该复选框并且用户登录,就应该在文件/数据库中存储布尔标志和ID/密码.下次显示该对话框时,请检查此存储的标志,如果它是"true",则不显示该对话框,而是仅使用存储的用户名和密码登录该用户.
或者,您可以始终显示登录表单,并在标志为true的情况下仅用存储的值填充文本框.

只需尝试将您的任务分解成简单的任务即可.这样,问题就很容易解决.
Hi,

I won''t give you code but some advice. You should store the checbox flag in some configuration file or database together with the user name/password. This means as soon as the checkbox is checked and the user logs in, you should store a boolean flag and id/password in a file/database. The next time the dialog would be shown, you check this stored flag and if it is "true", you don''t show the dialog and instead just login the user with the stored user name and password.
Alternatively you could always show the login form and just fill the textboxes with the stored values if the flag is true.

Just try to break down your task in simple tasks. This way the problem is quite easy to solve.


这篇关于如何在登录表单中使用“记住我"复选框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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