C# 登录界面如何让textbox实现记忆功能?能不通过写文本文件之类的方法嘛? 让textbox实现记忆功能,是将输入的内容写到数据库中或文本文件中,下次载入里读取数据库最新的几条记录 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 autocomplete实现不了。必须存储在文本文件(包括配置文件)、注册表或者数据库中。 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; } } } 通常把用户名,密码加密一下,保存在ini配置文件,打开登录界面时,再读取ini文件 放在配置文件(ini或者xml)中,下次使用直接用配置文件中读取 (初学者)C#将信息添加到dataset有一行代码不太明白。。 未将对象引用设置到对象的实例。 FLEXGRID的问题 求一个非常简单的正则表达式 如何用程序登陆网站(有帐号密码),并抓取得登陆后界面的源码数据 怎样让DataGridView里面的行充满整个grid? 求一画板 急急急! 什么样的数据结构可以做泛型对象的容器? 【醒目】鼠标的网格点捕获,有兴趣的人来看看,顺便帮顶,别沉下去了 task.run运行的顺序是什么 C#下如何获取光标的位置并在光标处输入字符 .NET调用DLL返回值问题
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;
}
}
}