Program.cs 933 B

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