Program.cs 1.3 KB

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