日期:2014-05-18 浏览次数:20424 次
protected void BtnLogin_Click(object sender, EventArgs e) { haifei.BLL.HF_USER BLLHFUSER = new haifei.BLL.HF_USER(); string PassMd5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.TxtPassword.Text,"MD5"); bool Islogin = BLLHFUSER.Login(this.TxtUsername.Text, PassMd5); if (Islogin == true) { System.Web.Security.FormsAuthentication.RedirectFromLoginPage(this.TxtUsername.Text, true); HttpCookie lcookie = Context.Response.Cookies[FormsAuthentication.FormsCookieName]; lcookie.Expires = DateTime.Now.AddYears(1); } }