コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            while (true)
            {
                confirm = new Confirm();
                confirm.ShowDialog(this);

                if (confirm.DialogResult == DialogResult.OK)
                {
                    password = new PassWord();

                    if (password.ConfirmPassWord(confirm.getpasswordText()) == true)
                    {
                        while (true)
                        {
                            broadpwmng = new BroadPWMng();
                            broadpwmng.ShowDialog(this);

                            if (broadpwmng.DialogResult == DialogResult.OK)
                            {
                                if (broadpwmng.Password.Trim() == broadpwmng.RePassword.Trim())
                                {
                                    Properties.Settings.Default.BroadPW = broadpwmng.Password.Trim();
                                    Properties.Settings.Default.Save();

                                    MessageBox.Show("암호를 변경하였습니다.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                                else
                                {
                                    MessageBox.Show("암호를 확인하세요.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                            }
                            else
                            {
                                return;
                            }
                        }
                    }
                    else
                    {
                        if (MessageBox.Show("암호가 정확하지 않습니다.\n다시 시도하겠습니까?", this.Text, MessageBoxButtons.RetryCancel, MessageBoxIcon.Information) == DialogResult.Retry)
                        {
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else
                {
                    break;
                }
            }
        }
コード例 #2
0
        private void AdminCB_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                if (this.AdminCB.Checked == true)
                {
                    while (true)
                    {
                        confirm = new Confirm();
                        confirm.ShowDialog(this);

                        if (confirm.DialogResult == DialogResult.OK)
                        {
                            password = new PassWord();

                            if (password.ConfirmPassWord(confirm.getpasswordText()) == true)
                            {
                                this.BroadTV.Enabled = true;
                                break;
                            }
                            else
                            {
                                if (MessageBox.Show("암호가 정확하지 않습니다.\n다시 시도하겠습니까?", this.Text, MessageBoxButtons.RetryCancel, MessageBoxIcon.Information) == DialogResult.Retry)
                                {
                                }
                                else
                                {
                                    this.AdminCB.Checked = false;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            this.AdminCB.Checked = false;
                            break;
                        }
                    }
                }
                else
                {
                    this.BroadTV.Enabled = false;
                }

                confirm  = null;
                password = null;
            }
            catch (Exception ex)
            {
                Console.WriteLine("OptionDlg.AdminCB_CheckedChanged - " + ex.Message);
            }
        }