static void Main() { //Application.ThreadException +=new System.Threading.ThreadExceptionEventHandler(BaseClass.Error.Application_ThreadException); string procName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; if ((System.Diagnostics.Process.GetProcessesByName(procName)).GetUpperBound(0) > 0) { MessageBox.Show("该程序已启动!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); Application.Exit(); } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); User.Login login = new User.Login(); if (login.ShowDialog() == DialogResult.OK) { login.Close(); Application.Run(new Main()); } } }
//换班 private void but_RRelief_Click(object sender, EventArgs e) { User.Login Login = new User.Login(); Login.ShowDialog(); StaticMain.MainFrm.FrmMain.lab_Operator.Text = Model.User.LUser.Name; if (Model.User.LUser.Id == 1) but_Power.Visible = true; else but_Power.Visible = false; }