コード例 #1
0
        protected void Buttonrestpassord_Click(object sender, EventArgs e)
        {
            CustomerUtility c = new CustomerUtility().getUserInfo(TextBoxuserName.Text);

            if (c.email.Equals(TextBoxEmail.Text))
            {
                int    rand        = new Random().Next(100000, 999999);
                string newPassword = "******" + rand;
                c.resetPassord(newPassword);
                LabelMessage.Visible   = true;
                LabelMessage.Text      = "Your Password has been reset,Please check your email";
                LabelMessage.ForeColor = System.Drawing.Color.Red;
                sendNotification(c.email, newPassword);
            }
            else
            {
                LabelMessage.Visible   = true;
                LabelMessage.Text      = "Your username or email is not correct";
                LabelMessage.ForeColor = System.Drawing.Color.Red;
            }
        }