private void btnStartProgram_Click(object sender, EventArgs e) { try { if (File.Exists(Local.AppConfig)) { FrmMain frm = new FrmMain { SqlConnection = Kryptos.Decrypt(XmlConfigurator.Read("Connections\\" + cbConnectionList.Text + ".config", "SqlConnectionString"), Kryptos.GetHardwareID()) }; frm.Show(); Hide(); } else { FrmSettings frm = new FrmSettings(); using (frm) { frm.FirstStart = true; frm.ShowDialog(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Uncaught Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void applicationSettingsToolStripMenuItem_Click(object sender, EventArgs e) { Forms.FrmSettings s = new Forms.FrmSettings(); using (s) { s.ShowDialog(); s.FirstStart = false; } }