Program.cs 916 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using System.Windows.Forms;
  6. namespace RailLocalMeter
  7. {
  8. static class Program
  9. {
  10. /// <summary>
  11. /// 应用程序的主入口点。
  12. /// </summary>
  13. [STAThread]
  14. static void Main()
  15. {
  16. bool createNew;
  17. using (System.Threading.Mutex m = new System.Threading.Mutex(true, Application.ProductName, out createNew))
  18. {
  19. if (createNew)
  20. {
  21. Application.EnableVisualStyles();
  22. Application.SetCompatibleTextRenderingDefault(false);
  23. Application.Run(new frmMain());//
  24. }
  25. else
  26. {
  27. MessageBox.Show("已启动该程序,不允许重复启动!");
  28. }
  29. }
  30. }
  31. }
  32. }