예제 #1
0
        private void changeFunc()
        {
            this.txtStatus.ForeColor = Color.Blue;
            this.txtStatus.Text      = "修改信息:正在修改...";
            Application.DoEvents();
            RegexInfo myLoginInfo = new RegexInfo();

            if (this.txtPasswd.Text != "" && this.txtChangeTo.Text != "")
            {
                if (this.txtPasswd.Text == this.txtChangeTo.Text)
                {
                    if (myLoginInfo.isPasswdSecurity(this.txtChangeTo.Text))
                    {
                        ManageDB myManageDB = new ManageDB();
                        myManageDB.UpdateDB("用户管理", "[passWord]", this.txtChangeTo);
                        TimeDelay myTimeDelay = new TimeDelay();
                        this.btnOK.Enabled     = false;
                        this.btnCancel.Enabled = false;
                        myTimeDelay.restartDelay(3, this.txtStatus, "修改信息:修改成功!", "请重新登录!");
                    }
                    else
                    {
                        this.txtStatus.ForeColor = Color.Red;
                        this.txtStatus.Text      = "修改信息:修改失败!密码为含数字、字母6位以上字符!";
                    }
                }
                else
                {
                    this.txtStatus.ForeColor = Color.Red;
                    this.txtStatus.Text      = "修改信息:修改失败,密码输入不一致!";
                }
            }
            else
            {
                this.txtStatus.ForeColor = Color.Red;
                this.txtStatus.Text      = "修改信息:修改失败,所有项不能为空!";
            }
        }
예제 #2
0
        private void myRegisterFunc()
        {
            ManageDB  myManageDB  = new ManageDB();
            RegexInfo myLoginInfo = new RegexInfo();

            this.txtStatus.ForeColor = Color.Blue;
            this.txtStatus.Text      = "注册信息:注册中...";
            Application.DoEvents();

            if (this.txtUserName.Text != "" && this.txtPasswd.Text != "" && this.txtConfirmPassWD.Text != "" & txtEmailAddress.Text != "" && this.txtUserFullName.Text != "")
            {
                if (myLoginInfo.isUserNameFair(this.txtUserName.Text))
                {
                    if (!myManageDB.checkUserNameDuplicate(this.txtUserName.Text))
                    {
                        if (this.txtPasswd.Text == this.txtConfirmPassWD.Text)
                        {
                            if (myLoginInfo.isPasswdSecurity(this.txtPasswd.Text))
                            {
                                if (myLoginInfo.isMailAddress(this.txtEmailAddress.Text))
                                {
                                    userName     = this.txtUserName.Text;
                                    passwd       = this.txtPasswd.Text;
                                    fullName     = this.txtUserFullName.Text;
                                    emailAddress = this.txtEmailAddress.Text;
                                    verificationReg();
                                    this.Visible = false;
                                    this.Close();
                                    UserAuthentication myAuthentication = new UserAuthentication();
                                    myAuthentication.Show();
                                }
                                else
                                {
                                    this.txtStatus.ForeColor = Color.Red;
                                    this.txtStatus.Text      = "注册信息:注册失败,请正确填写邮箱格式!";
                                }
                            }
                            else
                            {
                                this.txtStatus.ForeColor = Color.Red;
                                this.txtStatus.Text      = "注册信息:注册失败!密码为含数字、字母6-20位以上字符!";
                            }
                        }
                        else if (myManageDB.checkUserNameDuplicate(this.txtUserName.Text))
                        {
                            this.txtStatus.ForeColor = Color.Red;
                            this.txtStatus.Text      = "注册信息:注册失败,密码不一致!";
                        }
                    }
                    else
                    {
                        this.txtStatus.ForeColor = Color.Red;
                        this.txtStatus.Text      = "注册信息:注册失败,用户名已存在!";
                    }
                }
                else
                {
                    this.txtStatus.ForeColor = Color.Red;
                    this.txtStatus.Text      = "注册信息:注册失败,用户名为含数字、字母的6-20位字符!";
                }
            }
            else
            {
                this.txtStatus.ForeColor = Color.Red;
                this.txtStatus.Text      = "注册信息:注册失败,所有项均不能为空!";
            }
        }