private void MainForm_Load(object sender, EventArgs e) { this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea; timerDate.Start(); IOCenterManager.InitIOCenterManager(); IOCenterManager.QueryFormManager.InitQueryForm(this); if (isAuto) { IOCenterManager.LoadAll(); } else { LoginForm login = new LoginForm(); if (login.ShowDialog() == DialogResult.OK) { IOCenterManager.LoadAll(); } else { if (IOCenterManager.QueryFormManager != null) { IOCenterManager.QueryFormManager.CloseInfluxDBServer(); } IOCenterManager.Close(); Application.Exit(); Application.ExitThread(); } } }
private void 退出系统ToolStripMenuItem_Click(object sender, EventArgs e) { if (FrmDialog.ShowDialog(this, "是否要退出数据中心服务", "退出系统", true, true, true, true) == DialogResult.OK) { IOCenterManager.QueryFormManager.CloseInfluxDBServer(); IOCenterManager.Close(); Application.ExitThread(); Application.Exit(); Process[] pross = Process.GetProcessesByName(Application.ProductName); if (pross.Length > 0) { pross[0].Kill(); } } }