static void Main() { bool createNew; XmlDocument xml = new XmlDocument(); using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew)) { if (createNew) { Log.LogKeepPeriod = LogExpired.Threemonthes; LogEnviromentOperation.Instance.InitializeSetting(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Logo fl = new Logo(); if (fl.ShowDialog() == DialogResult.OK) { Application.Run(new Form1()); } } else { MessageBox.Show("应用程序已经在运行中!"); System.Threading.Thread.Sleep(1000); System.Environment.Exit(1); } } }
private void 登陆ToolStripMenuItem_Click(object sender, EventArgs e) { Logo l = new Logo(); l.ShowDialog(); }