コード例 #1
0
ファイル: cDiceBot.cs プロジェクト: bdcravens/DiceBot
        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);
                }
            }
        }
コード例 #2
0
ファイル: cDiceBot.cs プロジェクト: wmgjang/DiceBot
        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.");
            }
        }