Program.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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
  29. {
  30. Application.Run(new frmMain());//
  31. }
  32. }
  33. else
  34. {
  35. MessageBox.Show("已启动该程序,不允许重复启动!");
  36. }
  37. }
  38. }
  39. }
  40. }