¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Diagnostics; |
| | | using System.IO; |
| | | using System.Windows.Forms; |
| | | using CefSharp.WinForms; |
| | | using CefSharp; |
| | | 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 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 FrmMain()); |
| | | } |
| | | else |
| | | { |
| | | Application.Exit(); |
| | | } |
| | | } |
| | | } |
| | | } |