コード例 #1
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            if (!ValidateTextboxes())
            {
                return;
            }

            if (WebConnector.Register(this.txtUsername.Text, this.txtPassword.Text, this.txtEmail.Text, CreateBase64Image(pboxAvatarContainer.Image)))
            {
                MessageBox.Show("You have been successfully registered!", "Registration successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                MessageBox.Show("An error occurred while trying to register your account. Please try again.", "Registration error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }