using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Mtxfw.shop { public partial class Member_zhmm : System.Web.UI.Page { public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info(); public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(); public string Label_message = ""; protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { String UserId = Request.Form["txtUserId"]; String UserEmail = Request.Form["txtUserEmail"]; bool b = true; if (String.IsNullOrEmpty(UserId) || String.IsNullOrEmpty(UserEmail)) { b = false; Response.Write(""); } if (b) { if (!daoUser.IsExistsUserAndEmail(UserId, UserEmail)) { b = false; Response.Write(""); } else { DateTime dt = DateTime.Now; string UserP = dt.Year.ToString().Substring(2, 2) + dt.Month + dt.Day + dt.Hour + dt.Minute + dt.Second + dt.Millisecond; string EncryptUserP = Mtxfw.Utility.Security.EncryptString(UserP); if (daoUser.UpdatePassword("password", EncryptUserP, UserId) && daoUser.UpdatePassword("password2", EncryptUserP, UserId)) { try { //发送邮件 Mtxfw.Utility.Common.SendEmail(UserEmail, "找回密码", "
您的用户名是" + UserId + ",您的密码是" + UserP + "
"); Label_message = "成功发送,您的密码以及密码保护资料已发送到您的邮箱中,请查收!"; } catch { Label_message = "发送失败,请稍候再试!"; } } else { Label_message = "重置密码失败,请稍候再试!"; } } } } } } }