C# 登录界面如何让textbox实现记忆功能?能不通过写文本文件之类的方法嘛?

realkinglion 2014-07-10 10:14:40
C# 登录界面如何让textbox实现记忆功能?能不通过写文本文件之类的方法嘛?查到有个什么autocomplete属性,具体该怎么用呢?好使吗?请大家指教啊
...全文
431 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
renmiaoxin 2014-07-15
  • 打赏
  • 举报
回复
都要读写文件吧。不过你可以加密。
聆听灬莫问 2014-07-14
  • 打赏
  • 举报
回复
放在配置文件(ini或者xml)中,下次使用直接用配置文件中读取
wefendou 2014-07-13
  • 打赏
  • 举报
回复
通常把用户名,密码加密一下,保存在ini配置文件,打开登录界面时,再读取ini文件
mml_2643385463 2014-07-13
  • 打赏
  • 举报
回复
Cookie实现密码记忆功能 protected void Button1_Click(object sender, EventArgs e) { if (txtname.Text.Trim().Equals("mr") && txtpwd.Text.Trim().Equals("mrsoft")) { Session["username"] = txtname.Text.Trim(); if (ckbauto.Checked) { if (Request.Cookies["username"] == null) { Response.Cookies["username"].Expires = DateTime.Now.AddDays(30); Response.Cookies["userpwd"].Expires = DateTime.Now.AddDays(30); Response.Cookies["username"].Value = txtname.Text.Trim(); Response.Cookies["userpwd"].Value = txtpwd.Text.Trim(); } } Response.Redirect("admin.aspx"); } else { ClientScript.RegisterStartupScript(this.GetType(),"","alert('用户名或密码错误!');",true); } } protected void txtname_TextChanged(object sender, EventArgs e) { if (Request.Cookies["username"] != null) {//CodeGo.net/ if (Request.Cookies["username"].Value.Equals(txtname.Text.Trim())) { txtpwd.Attributes["value"] = Request.Cookies["userpwd"].Value; } } }
lc_ant 2014-07-11
  • 打赏
  • 举报
回复
每次登陆成功后就把账号信息保存到文件中
devmiao 2014-07-10
  • 打赏
  • 举报
回复
autocomplete实现不了。必须存储在文本文件(包括配置文件)、注册表或者数据库中。
wind_cloud2011 2014-07-10
  • 打赏
  • 举报
回复
让textbox实现记忆功能,是将输入的内容写到数据库中或文本文件中,下次载入里读取数据库最新的几条记录

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧