using System; using System.Windows.Forms; using DevExpress.UserSkins; using DevExpress.Skins; using ProjectBase.Data.Logs; using System.Threading; namespace SIMDP { static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { log4net.Config.XmlConfigurator.Configure(); LogHelper.log.Info("开始启动程序...."); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //防止双开 string MName = System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName; string PName = System.IO.Path.GetFileNameWithoutExtension(MName); System.Diagnostics.Process[] myProcess = System.Diagnostics.Process.GetProcessesByName(PName); if (myProcess.Length > 1) { MessageBox.Show("应用程序已经在运行中!", "提示"); Thread.Sleep(1000); System.Environment.Exit(1); return; } BonusSkins.Register(); SkinManager.EnableFormSkins(); Application.Run(new MainForm()); } } }