记住登录页面中的密码 [英] Remember password in login page

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

问题描述

我在登录页面中给出了记住密码的代码。

i have given code for remember password in login page.

if (Request.Cookies["myCookie"] != null)
{
HttpCookie cookie = Request.Cookies.Get("myCookie");
if (txtusername.Text == cookie.Values["username"])
{
txtpassword.Text = cookie.Values["password"];
CheckBox1.Checked = true;
}
}



当我将密码textmode设置为单行时,如果我将textmode更改为密码,则无效。如何为此编码?


it works when i set password textmode as singleline, if i change to textmode as password its not working. how to code for that?

推荐答案

你有没有理由自己做这一切?



您是否考虑过使用会员资格 [ ^ ]而是?它为您处理所有这些,并提供内置的方法来自动重定向未登录到登录页面然后登录到他们请求的页面的成员 - 这是手动操作的麻烦。
Is there a reason why you are doing all this yourself?

Have you considered using Membership[^] instead? It handles all this for you, and provides built in ways to automatically redirect members who aren''t logged in to the Login page then to the page they requested - which is a nuisance to do manually.


这篇关于记住登录页面中的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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