From 9872d678fc6703101d02f68b88b7519a0b6bc82c Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期二, 05 十一月 2024 14:15:06 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- DevApp/Gs.DevApp/Program.cs | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 55 insertions(+), 0 deletions(-) diff --git a/DevApp/Gs.DevApp/Program.cs b/DevApp/Gs.DevApp/Program.cs new file mode 100644 index 0000000..e411b96 --- /dev/null +++ b/DevApp/Gs.DevApp/Program.cs @@ -0,0 +1,55 @@ +锘縰sing System; +using System.Diagnostics; +using System.IO; +using System.Windows.Forms; +using Gs.DevApp.DevFrm; + +namespace Gs.DevApp +{ + internal static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + private static void Main() + { + var processName = + Path.GetFileNameWithoutExtension(Process.GetCurrentProcess() + .MainModule.FileName); + var processes = Process.GetProcessesByName(processName); + if (processes.Length > 1) + { + MessageBox.Show("绋嬪簭宸茬粡鍦ㄨ繍琛岋紒"); + Environment.Exit(0); + } + else + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + _startLogin(); + } + } + + /// <summary> + /// 鐧诲綍椤靛惎鍔� + /// </summary> + private static void _startLogin() + { + //Application.Run(new TestForm.XtraForm2()); + //return; + + var fmLogin = new FrmLogin(); + if (fmLogin.IsDisposed == false) + { + fmLogin.ShowDialog(); + if (fmLogin.DialogResult == DialogResult.OK) + Application.Run(new FrmMain()); + } + else + { + Application.Exit(); + } + } + } +} \ No newline at end of file -- Gitblit v1.9.3