private void btnRegister_Click(object sender, EventArgs e) { if (CurrentSite.register) { ConfirmPassword Conf = new ConfirmPassword(); bool Valid = false; if (Conf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Valid = Conf.Password == txtApiPassword.Text; } if (Valid) { if (CurrentSite.Register(txtApiUsername.Text, txtApiPassword.Text)) { EnableNotLoggedInControls(true); } } else { MessageBox.Show("Registration Failed."); } } else { if (MessageBox.Show(string.Format("It looks like {0} does not allow registration through the API. Would you like to open {0} in your browser to register an account?", CurrentSite.Name)) == DialogResult.OK) { Process.Start(CurrentSite.SiteURL); } } }
private void btnRegister_Click(object sender, EventArgs e) { ConfirmPassword Conf = new ConfirmPassword(); bool Valid = false; if (Conf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Valid = Conf.Password == txtApiPassword.Text; } if (Valid) { if (CurrentSite.Register(txtApiUsername.Text, txtApiPassword.Text)) { EnableNotLoggedInControls(true); } } else { MessageBox.Show("Registration Failed."); } }