Ejemplo n.º 1
0
        private void Go_Click(object sender, EventArgs e)
        {
            this.Go.Cursor = System.Windows.Forms.Cursors.AppStarting;
            if (!tbNewPassword.Text.Equals(textBox1.Text))
            {
                MessageBox.Show("两次密码输入不一致", "", MessageBoxButtons.OK, MessageBoxIcon.None);
                tbNewPassword.Focus();
                this.Go.Cursor = System.Windows.Forms.Cursors.Default;
                return;
            }
            if (tbValidCode.Text == "" || tbValidCode.Text == null)
            {
                MessageBox.Show("请填写验证码", "", MessageBoxButtons.OK, MessageBoxIcon.None);
                tbValidCode.Focus();
                this.Go.Cursor = System.Windows.Forms.Cursors.Default;
                return;
            }
            if (!tbValidCode.Text.Equals(code))
            {
                MessageBox.Show("验证码错误", "", MessageBoxButtons.OK, MessageBoxIcon.None);
                this.Go.Cursor = System.Windows.Forms.Cursors.Default;
                return;
            }
            string     id          = tbId.Text;
            string     Email       = tbEmail.Text;
            string     NickName    = tbNickName.Text;
            string     newPassword = tbNewPassword.Text;
            MIDDLEENUM mess        = new LogonMiddle().forgetPassword(id, Email, NickName, newPassword);
            string     info        = "";

            switch (mess)
            {
            case MIDDLEENUM.未知错误:
                info = "未知错误";
                break;

            case MIDDLEENUM.数据不存在:
                info = "数据不存在";
                break;

            case MIDDLEENUM.制表_45错误:
                info = "更新密码失败";
                break;

            case MIDDLEENUM.更新密码失败:
                info = "更新密码失败";
                break;

            case MIDDLEENUM.更新密码成功:
                info = "更新密码成功";
                break;

            default:
                break;
            }
            MessageBox.Show(info, "", MessageBoxButtons.OK, MessageBoxIcon.None);
            this.Go.Cursor = System.Windows.Forms.Cursors.Default;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 线程执行方法
        /// </summary>
        private void sw()
        {
            string      mess   = "ERROR";
            bool        close  = false;
            LogonMiddle middle = new LogonMiddle();

            switch (middle.unscrambleSigninToLogin(tbId.Text, tbPwd.Text, tbEmail.Text, loginOrLogon, ref NickName, ref LogonTime, ref LoginInfo))
            {
            case MIDDLEENUM.内容不允许为空:
                mess = "内容不允许为空";
                break;

            case MIDDLEENUM.邮箱已存在:
                mess = "邮箱已存在";
                break;

            case MIDDLEENUM.发送邮件错误:
                mess = "发送邮件错误";
                break;

            case MIDDLEENUM.账号或密码错误:
                mess = "账号或密码错误";
                break;

            case MIDDLEENUM.未知错误:
                mess = "未知错误";
                break;

            case MIDDLEENUM.登录成功:
                mess  = "登录成功";
                close = true;
                break;

            case MIDDLEENUM.注册成功:
                mess = "注册成功,请记住你的ID,这将是你以后的唯一登录方式:\r\n" + middle.reId;
                label3_Click(null, null);
                break;

            default:
                break;
            }
            MessageBox.Show(mess, "", MessageBoxButtons.OK, MessageBoxIcon.None);
            if (close)
            {
                this.Close();
            }
            this.Go.Cursor = Cursors.Default;
        }
Ejemplo n.º 3
0
 private static Process process = ProcessStart.processStart("PianoLoad\\PianoLoad.exe"); //打开等待页面
 /// <summary>
 /// 静态代码块
 /// </summary>
 static PianoMain()
 {
     try {
         //屏幕分辨率
         IniWindowsSize windowsSize = new IniWindowsSize();
         if (!windowsSize.windowsSize(1920, 1080))
         {
             new OpenWarning().ShowDialog();
             exit = true;
             MessageBox.Show("当前分辨率:" + windowsSize.getX() + "px*" + windowsSize.getY() + "px\r\n点击退出", "分辨率不一致", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         string id_      = WriteIP.getId();
         string password = WriteIP.getPassword();
         if (id_ != null && password != null)
         {
             id        = Convert.ToInt32(id_);
             LoginInfo = true;
         }
         //初始登录方法
         MIDDLEENUM MIDDLEENUM = new LogonMiddle().unscrambleSigninToLogin(id, password, ref NickName, ref logonTime, ref LoginInfo);
     } catch {
     }
 }