Program.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using System.Windows.Forms;
  6. namespace CarLocalMeter
  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. if (AppConfigCache.productType == "0")
  24. {
  25. Application.Run(new frmMain());//
  26. }
  27. else
  28. {
  29. Application.Run(new frmMain());//
  30. }
  31. }
  32. else
  33. {
  34. MessageBox.Show("已启动该程序,不允许重复启动!");
  35. }
  36. }
  37. }
  38. }
  39. }