protected void btn_Sure_Click(object sender, EventArgs e) { UserBLL uBLL = new UserBLL(); string userID = Session["UserID"].ToString(); string oldPwd = txt_Old.Text.Trim(); string newPwd = txt_New.Text.Trim(); //判断旧密码是否正确 Model.User user = uBLL.GetModel(userID); if (user.Password != oldPwd) { UtilityService.Alert(this.Page,"旧密码不正确,请重新输入"); txt_Old.Focus(); return; } bool re = new UserBLL().UpdatePwd(userID, newPwd); if (re) { UtilityService.Alert(this.Page, "修改成功"); //Session["OrganID"] = null; //Session["UserID"] = null; //Session["UserName"] = null; //Session["FcList"] = null; ////Response.Redirect("UpdatePwd.aspx"); } else { UtilityService.Alert(this.Page, "修改失败!"); } }
public string BackPwdMail(string UserId) { StringBuilder w = new StringBuilder(); UserBLL ubll = new UserBLL(); Model.UserInfoModel model = ubll.GetModel(UserId); string key = BackUserKey(model.UserId, model.Pwd); w.Append("<p>尊敬的沂源信息港用户 <strong>" + UserId + "</strong>: </p> "); w.Append("<div style='margin-left: 30px;'>"); w.Append("<p>您好!</p>"); w.Append("<p>您也可以点击如下链接来完成帐号验证。</p>"); w.Append("<p><a href='http://*****:*****@qq.com QQ:16248777 谢谢!</p>"); w.Append("</div>"); w.Append("<p>此为系统消息,请勿回复</p>"); w.Append(@"<style type='text/css'> body { font-size: 14px; font-family: arial,verdana,sans-serif; line-height: 1.666; padding: 0; margin: 0; overflow: auto; white-space: normal; word-wrap: break-word; min-height: 100px; } td, input, button, select, body { font-family: Helvetica, 'Microsoft Yahei', verdana; } pre { white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; } th, td { font-family: arial,verdana,sans-serif; line-height: 1.666; } img { border: 0; } header, footer, section, aside, article, nav, hgroup, figure, figcaption { display: block; } </style> <style id='ntes_link_color' type='text/css'> a, td a { color: #003399; } </style>"); if (Common.Validator.IsEmail(model.Email)) { Common.Mail.Send("取回密码验证邮件[南麻街 - 沂源信息港旗下生活服务平台]", w.ToString(), model.Email); } else { throw new Exception(model.Email + "好像不是一个合法邮件!"); } return(model.Email); }