protected void btnSubmit_Click(object sender, EventArgs e) { //判断是否存在用户名及验证码是否正确 if (Session["SiteCheckCode"] == null) { MojoCube.Api.UI.Script.ScriptMessage(this, "请填写验证码"); return; } if (Session["SiteCheckCode"] != null && Session["SiteCheckCode"].ToString().ToLower() != txtCode.Text.Trim().ToLower()) { MojoCube.Api.UI.Script.ScriptMessage(this, "验证码错误"); return; } MojoCube.Web.Member.List user = new MojoCube.Web.Member.List(); if (user.ChkUser(txtPhone.Text.Trim(), txtEmail.Text.Trim()) && !user.IsCheck) { user.GetData(txtPhone.Text.Trim()); SendMail(user.Email, user.CheckCode, user.FirstName, user.LastName, user.UserName); MojoCube.Api.UI.Script.ScriptMessage(this, "确认邮件已经发送,请查收邮箱!"); } else if (user.pk_Member > 0 && user.IsCheck) { MojoCube.Api.UI.Script.ScriptMessage(this, "您的账号已经确认,请登录!"); } else { MojoCube.Api.UI.Script.ScriptMessage(this, "该手机号没有被注册!"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { //判断是否存在用户名及验证码是否正确 if (Session["SiteCheckCode"] == null) { MojoCube.Api.UI.Script.ScriptMessage(this, "请填写验证码"); return; } if (Session["SiteCheckCode"] != null && Session["SiteCheckCode"].ToString().ToLower() != txtCode.Text.Trim().ToLower()) { MojoCube.Api.UI.Script.ScriptMessage(this, "验证码错误"); return; } MojoCube.Web.Member.List user = new MojoCube.Web.Member.List(); if (user.ChkUser(txtPhone.Text.Trim(), txtEmail.Text.Trim())) { user.GetData(txtPhone.Text.Trim()); if (user.IsCheck) { string password = Guid.NewGuid().ToString().Substring(0, 6); user.UpdateMember_UserPass(user.pk_Member, FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5").ToLower()); SendMail(user.Email, user.FirstName, user.LastName, user.UserName, password); MojoCube.Api.UI.Script.ScriptMessage(this, "新密码已经发到您的邮箱,请查收邮箱!"); } else { MojoCube.Api.UI.Script.ScriptMessage(this, "该用户尚未激活账号!"); } txtPhone.Text = ""; txtEmail.Text = ""; txtCode.Text = ""; btnSubmit.Enabled = false; } else { MojoCube.Api.UI.Script.ScriptMessage(this, "错误的手机号或邮箱"); } }