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 RailLocalMeter
  7. {
  8. static class Program
  9. {
  10. /// <summary>
  11. /// 应用程序的主入口点。
  12. /// </summary>
  13. [STAThread]
  14. static void Main()
  15. {
  16. byte[] bt = new byte[10];
  17. bt[0] = 31;
  18. bt[1] = 32;
  19. bt[2] = 20;
  20. string strtmp = System.Text.Encoding.UTF8.GetString(bt)?.Trim();
  21. bool createNew;
  22. using (System.Threading.Mutex m = new System.Threading.Mutex(true, Application.ProductName, out createNew))
  23. {
  24. if (createNew)
  25. {
  26. Application.EnableVisualStyles();
  27. Application.SetCompatibleTextRenderingDefault(false);
  28. Application.Run(new frmMain());//
  29. }
  30. else
  31. {
  32. MessageBox.Show("已启动该程序,不允许重复启动!");
  33. }
  34. }
  35. }
  36. }
  37. }