| | |
| | | using DevExpress.LookAndFeel; |
| | | using DevExpress.Skins; |
| | | using DevExpress.UserSkins; |
| | | using CefSharp; |
| | | using CefSharp.WinForms; |
| | | using Gs.DevApp.DevFrm; |
| | | using Gs.DevApp.DevFrm.Work; |
| | | using Gs.DevApp.Properties; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Diagnostics; |
| | | using System.IO; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace Gs.DevApp |
| | | { |
| | | static class Program |
| | | internal static class Program |
| | | { |
| | | /// <summary> |
| | | /// The main entry point for the application. |
| | | /// The main entry point for the application. |
| | | /// </summary> |
| | | [STAThread] |
| | | static void Main() |
| | | private static void Main() |
| | | { |
| | | Application.EnableVisualStyles(); |
| | | Application.SetCompatibleTextRenderingDefault(false); |
| | | //Application.Run(new Gs.DevApp.TestForm.FluentDesignForm1()); |
| | | //Application.Run(new Gs.DevApp.DevFrm.BasicData.FrmMesItems()); |
| | | DevFrm.FrmLogin fmLogin = new DevFrm.FrmLogin(); |
| | | fmLogin.ShowDialog(); |
| | | if (fmLogin.DialogResult == DialogResult.OK) |
| | | var processName = |
| | | Path.GetFileNameWithoutExtension(Process.GetCurrentProcess() |
| | | .MainModule.FileName); |
| | | var processes = Process.GetProcessesByName(processName); |
| | | if (processes.Length > 1) |
| | | { |
| | | //在线程中打开主窗体 |
| | | Application.Run(new DevFrm.FrmMain()); |
| | | MessageBox.Show("程序已经在运行!"); |
| | | Environment.Exit(0); |
| | | } |
| | | else |
| | | { |
| | | Application.EnableVisualStyles(); |
| | | Application.SetCompatibleTextRenderingDefault(false); |
| | | _startLogin(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 登录页启动 |
| | | /// </summary> |
| | | private static void _startLogin() |
| | | { |
| | | //Application.Run(new Gs.DevApp.XtraForm1()); |
| | | //return; |
| | | |
| | | CefSettings settings = new CefSettings(); |
| | | settings.Locale = "zh-CN"; |
| | | Cef.Initialize(settings); |
| | | var fmLogin = new FrmLogin(); |
| | | if (fmLogin.IsDisposed == false) |
| | | { |
| | | fmLogin.ShowDialog(); |
| | | if (fmLogin.DialogResult == DialogResult.OK) |
| | | { |
| | | //Application.Run(new DevFrm.User.SysMenu()); |
| | | //return; |
| | | bool IsWeight = false; |
| | | try |
| | | { |
| | | IsWeight = Settings.Default.isWeight; |
| | | } |
| | | catch (Exception) |
| | | { |
| | | } |
| | | if (IsWeight == true) |
| | | Application.Run(new Frm_Work09()); |
| | | else |
| | | Application.Run(new FrmMain()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Application.Exit(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |