예제 #1
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            DialogResult resultApplyChanges = MessageBox.Show("Apply changes?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (resultApplyChanges == DialogResult.Yes)
            {
                if (Program.isPwdEnabled)
                {
                    frmPasswordCheck frmPwdCheck = new frmPasswordCheck();
                    frmPwdCheck.ShowDialog();

                    if (frmPwdCheck.DialogResult != DialogResult.OK)
                    {
                        return;
                    }
                }
                if (USB_radio_Disabled.Checked == true)
                {
                    USB_disableAllStorageDevices();
                }
                else if (USB_radio_ReadOnly.Checked == true)
                {
                    USB_enableAllStorageDevices();
                    USB_enableWriteProtect();
                }
                else
                {
                    USB_enableAllStorageDevices();
                    USB_disableWriteProtect();
                }

                if (REG_cbox_DisableRegistry.Checked == true)
                {
                    REG_DisableRegedit();
                }
                else
                {
                    REG_EnableRegedit();
                }
                MessageBox.Show
                    ("In order to enable new setting please" +
                    " reconnect your USB storage devices" +
                    " or restart your computer", "Information",
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void btnApply_Click(object sender, EventArgs e)
        {
            DialogResult resultApplyChanges = MessageBox.Show
                ("Apply changes?", "Confirm",
                MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            
            if (resultApplyChanges == DialogResult.Yes)
            {
                if (Program.isPwdEnabled)
                {
                    frmPasswordCheck frmPwdCheck = new frmPasswordCheck();
                    frmPwdCheck.ShowDialog();

                    if (frmPwdCheck.DialogResult != DialogResult.OK)
                        return;
                }
                if (USB_radio_Disabled.Checked == true)
                {
                    USB_disableAllStorageDevices();
                }
                else if (USB_radio_ReadOnly.Checked == true)
                {
                    USB_enableAllStorageDevices();
                    USB_enableWriteProtect();
                }
                else
                {
                    USB_enableAllStorageDevices();
                    USB_disableWriteProtect();
                }

                if (REG_cbox_DisableRegistry.Checked == true)
                {
                    REG_DisableRegedit();
                }
                else
                {
                    REG_EnableRegedit();
                }
                MessageBox.Show
                    ("In order to enable new setting please" +
                    " reconnect your USB storage devices" +
                    " or restart your computer", "Information",
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }