using System; using System.Threading; using System.Windows.Forms; namespace TsSFCDevice.Client.Launch { static class Program { /// /// 应用程序的主入口点。 /// [STAThread] static void Main() { //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new Form1()); bool isAppRunning; using (Mutex mutex = new Mutex(true, "设备管理软件", out isAppRunning)) { if (!isAppRunning) { // 如果应用程序已在运行,则显示一个消息框并退出。 XtraMessageBoxHelper.Error("应用程序已运行。"); return; } Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // 测试其他的窗口 //Form f = new Form() { Size = new Size(480, 850), StartPosition = FormStartPosition.CenterScreen }; //f.Controls.Add(new Pages.Tag.xueTagForm() { Dock = DockStyle.Fill }); //Application.Run(new Pages.Plan.pageMaintenanceRecord()); //return; frmLogin login = new frmLogin(); if (login.ShowDialog() == DialogResult.OK) { Application.Run(new frm_Launch()); } } } } }