日期:2014-05-17 浏览次数:20417 次
if (rmbUser.Checked)//记住密码
{
HttpCookie cook = new HttpCookie ("Cookie");
cook.Values.Add ("name", model.LoginId);
cook.Values.Add ("pwd", pwd.Text);
cook.Expires.Add (TimeSpan.FromDays (7));
Response.AppendCookie (cook);
}
else
{
HttpCookie ck = Request.Cookies["Cookie"];
if (ck != null)
{
ck.Expires = DateTime.Now.AddDays (-1);
Response.AppendCookie (ck);
}
}
if (Request.Cookies["Cookie"] != null)
{
HttpCookie cookie=Request.Cookies["Cookie"] ;
name.Text = cookie.Values["name"];
pwd.Attributes.Add ("value", cookie.Values["pwd"]);
rmbUser.Checked = true;
}