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; }
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; }
private void bGImport_Click(object sender, EventArgs e) { OpenFileDialog browseFile = new OpenFileDialog(); browseFile.Title = "Select server list"; browseFile.Filter = "TXT File (*.txt)|*.txt"; if (browseFile.ShowDialog() == DialogResult.OK) { string file = browseFile.FileName; if (File.Exists(file)) { importpopup = new popupImport(this); object[] bwArgs = { "import", file }; bwProgress.RunWorkerAsync(bwArgs); importpopup.ShowDialog(this); return; } } }