private void miServerDetails_Click(object sender, EventArgs e) { try { frmDbConfig fdc = new frmDbConfig(); fdc.ShowDialog(); } catch (Exception ex) { CommonLogger.Info(ex.ToString()); } }
public frmLogin() { try { InitializeComponent(); //MessageBox.Show("checking registry value"); //opening the subkey RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\HospitalERP"); //if it does exist, retrieve the stored values if (key != null) { var frun = key.GetValue("first_run"); key.Close(); if (frun.ToString() == "true") { //show frmDbConfig frmDbConfig fdc = new frmDbConfig(); fdc.ShowDialog(); //after closing server check tem has changed. //If not don't show the login form key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\HospitalERP\dset\", true); //if it does exist, retrieve the stored values if (key != null) { frun = key.GetValue("reset"); if (frun.ToString() == "false") { Environment.Exit(1); //Application.Exit(); } } } //MessageBox.Show("Registry fn finished"); } } catch (Exception ex) { CommonLogger.Info(ex.ToString()); } }