Inheritance: System.Windows.Forms.Form
Example #1
0
        private void bPassword_Click(object sender, EventArgs e)
        {
            if (tbGPassword.Text.Trim() == "")
            {
                MessageBox.Show(this, "Password can't be empty", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                tbGPassword.Text = "";
                tbGConfirm.Text  = "";
            }
            else if (tbGConfirm.Text != tbGPassword.Text)
            {
                MessageBox.Show(this, "Password confirmation doesn't match", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                tbGConfirm.Text = "";
            }
            else
            {
                if (Settings.Default.password != tbGPassword.Text)
                {
                    Settings.Default.password = tbGPassword.Text;
                    mainform.XmlConfigSet("password", mainform.Encrypt(Settings.Default.password, Settings.Default.pcryptkey));

                    string[] bwArgs = { "recrypt", Settings.Default.password };
                    bwProgress.RunWorkerAsync(bwArgs);
                    recryptpopup      = new popupRecrypt(this);
                    recryptpopup.Text = "Applying" + recryptpopup.Text;
                    recryptpopup.ShowDialog(this);

                    Settings.Default.cryptkey = Settings.Default.password;
                }
                bGPassword.Enabled = false;
            }
        }
Example #2
0
        private void cbGPassword_CheckedChanged(object sender, EventArgs e)
        {
            if (cbGPassword.Checked)
            {
                tbGPassword.Enabled = true;
                tbGConfirm.Enabled  = true;
            }
            else
            {
                if (Settings.Default.password != "")
                {
                    string[] bwArgs = { "recrypt", Settings.Default.ocryptkey };
                    bwProgress.RunWorkerAsync(bwArgs);
                    recryptpopup      = new popupRecrypt(this);
                    recryptpopup.Text = "Removing" + recryptpopup.Text;
                    recryptpopup.ShowDialog(this);

                    mainform.XmlDropNode("ID='password'");
                    Settings.Default.password = "";
                    Settings.Default.cryptkey = Settings.Default.ocryptkey;
                }

                tbGPassword.Enabled = false;
                tbGPassword.Text    = "";
                tbGConfirm.Enabled  = false;
                tbGConfirm.Text     = "";
                bGPassword.Enabled  = false;
            }
        }
Example #3
0
        public formOptions(formMain form)
        {
            mainform = form;
            InitializeComponent();
            importpopup  = new popupImport(this);
            recryptpopup = new popupRecrypt(this);

            Settings.Default.ocryptkey = Settings.Default.cryptkey;

            if (File.Exists(Settings.Default.cfgpath))
            {
                tbPuTTYPath.Text       = Settings.Default.puttypath;
                cbPuTTYExecute.Checked = Settings.Default.puttyexecute;
                tbPuTTYExecute.Text    = Settings.Default.puttycommand;
                cbPuTTYKey.Checked     = Settings.Default.puttykey;
                tbPuTTYKey.Text        = Settings.Default.puttykeyfile;
                cbPuTTYForward.Checked = Settings.Default.puttyforward;

                tbRDPath.Text      = Settings.Default.rdpath;
                tbRDKeep.Text      = Settings.Default.rdfilespath;
                cbRDAdmin.Checked  = Settings.Default.rdadmin;
                cbRDDrives.Checked = Settings.Default.rddrives;
                cbRDSpan.Checked   = Settings.Default.rdspan;
                cbRDSize.Text      = Settings.Default.rdsize;

                tbVNCPath.Text          = Settings.Default.vncpath;
                tbVNCKeep.Text          = Settings.Default.vncfilespath;
                cbVNCFullscreen.Checked = Settings.Default.vncfullscreen;
                cbVNCViewonly.Checked   = Settings.Default.vncviewonly;

                tbWSCPPath.Text       = Settings.Default.winscppath;
                cbWSCPKey.Checked     = Settings.Default.winscpkey;
                tbWSCPKey.Text        = Settings.Default.winscpkeyfile;
                cbWSCPPassive.Checked = Settings.Default.winscppassive;

                slGMulti.Value      = Convert.ToInt32(Settings.Default.multicolumnwidth);
                cbGMulti.Checked    = Settings.Default.multicolumn;
                cbGMinimize.Checked = Settings.Default.minimize;
                if (Settings.Default.password.Trim() != "")
                {
                    Settings.Default.password = mainform.Decrypt(Settings.Default.password, Settings.Default.pcryptkey);
                    tbGPassword.Text          = Settings.Default.password;
                    tbGConfirm.Text           = Settings.Default.password;
                    Settings.Default.cryptkey = Settings.Default.password;
                    cbGPassword.Checked       = true;
                }
            }

            bGPassword.Enabled = false;
            firstread          = false;
        }
Example #4
0
        public formOptions(formMain form)
        {
            mainform = form;
            InitializeComponent();
            importpopup = new popupImport(this);
            recryptpopup = new popupRecrypt(this);

            Settings.Default.ocryptkey = Settings.Default.cryptkey;

            if (File.Exists(Settings.Default.cfgpath))
            {
                tbPuTTYPath.Text = Settings.Default.puttypath;
                cbPuTTYExecute.Checked = Settings.Default.puttyexecute;
                tbPuTTYExecute.Text = Settings.Default.puttycommand;
                cbPuTTYKey.Checked = Settings.Default.puttykey;
                tbPuTTYKey.Text = Settings.Default.puttykeyfile;
                cbPuTTYForward.Checked = Settings.Default.puttyforward;

                tbRDPath.Text = Settings.Default.rdpath;
                tbRDKeep.Text = Settings.Default.rdfilespath;
                cbRDAdmin.Checked = Settings.Default.rdadmin;
                cbRDDrives.Checked = Settings.Default.rddrives;
                cbRDSpan.Checked = Settings.Default.rdspan;
                cbRDSize.Text = Settings.Default.rdsize;

                tbVNCPath.Text = Settings.Default.vncpath;
                tbVNCKeep.Text = Settings.Default.vncfilespath;
                cbVNCFullscreen.Checked = Settings.Default.vncfullscreen;
                cbVNCViewonly.Checked = Settings.Default.vncviewonly;

                tbWSCPPath.Text = Settings.Default.winscppath;
                cbWSCPKey.Checked = Settings.Default.winscpkey;
                tbWSCPKey.Text = Settings.Default.winscpkeyfile;

                slGMulti.Value = Convert.ToInt32(Settings.Default.multicolumnwidth);
                cbGMulti.Checked = Settings.Default.multicolumn;
                cbGMinimize.Checked = Settings.Default.minimize;
                if (Settings.Default.password.Trim() != "")
                {
                    Settings.Default.password = mainform.Decrypt(Settings.Default.password, Settings.Default.pcryptkey);
                    tbGPassword.Text = Settings.Default.password;
                    tbGConfirm.Text = Settings.Default.password;
                    Settings.Default.cryptkey = Settings.Default.password;
                    cbGPassword.Checked = true;
                }
            }

            bGPassword.Enabled = false;
            firstread = false;
        }
Example #5
0
        private void cbGPassword_CheckedChanged(object sender, EventArgs e)
        {
            if (cbGPassword.Checked)
            {
                tbGPassword.Enabled = true;
                tbGConfirm.Enabled = true;
            }
            else
            {
                if (Settings.Default.password != "")
                {
                    string[] bwArgs = {"recrypt", Settings.Default.ocryptkey};
                    bwProgress.RunWorkerAsync(bwArgs);
                    recryptpopup = new popupRecrypt(this);
                    recryptpopup.Text = "Removing" + recryptpopup.Text;
                    recryptpopup.ShowDialog(this);

                    mainform.XmlDropNode("ID='password'");
                    Settings.Default.password = "";
                    Settings.Default.cryptkey = Settings.Default.ocryptkey;
                }

                tbGPassword.Enabled = false;
                tbGPassword.Text = "";
                tbGConfirm.Enabled = false;
                tbGConfirm.Text = "";
                bGPassword.Enabled = false;
            }
        }
Example #6
0
        private void bPassword_Click(object sender, EventArgs e)
        {
            if (tbGPassword.Text.Trim() == "")
            {
                MessageBox.Show(this, "Password can't be empty", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                tbGPassword.Text = "";
                tbGConfirm.Text = "";
            }
            else if (tbGConfirm.Text != tbGPassword.Text)
            {
                MessageBox.Show(this, "Password confirmation doesn't match", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                tbGConfirm.Text = "";
            }
            else
            {
                if (Settings.Default.password != tbGPassword.Text)
                {
                    Settings.Default.password = tbGPassword.Text;
                    mainform.XmlConfigSet("password", mainform.Encrypt(Settings.Default.password, Settings.Default.pcryptkey));

                    string[] bwArgs = {"recrypt", Settings.Default.password};
                    bwProgress.RunWorkerAsync(bwArgs);
                    recryptpopup = new popupRecrypt(this);
                    recryptpopup.Text = "Applying" + recryptpopup.Text;
                    recryptpopup.ShowDialog(this);

                    Settings.Default.cryptkey = Settings.Default.password;
                }
                bGPassword.Enabled = false;
            }
        }