Program.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using Common;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Diagnostics;
  5. using System.Linq;
  6. using System.Windows.Forms;
  7. namespace LisPacsDataUpload
  8. {
  9. static class Program
  10. {
  11. /// <summary>
  12. /// 应用程序的主入口点。
  13. /// </summary>
  14. [STAThread]
  15. static void Main()
  16. {
  17. Application.EnableVisualStyles();
  18. Application.SetCompatibleTextRenderingDefault(false);
  19. #region 控制程序只能打开一次 检测进程中是否存在有不同pid、相同程序名的;
  20. Process process = Process.GetCurrentProcess();
  21. if (Process.GetProcesses().Any(s => s.ProcessName == process.ProcessName && (!s.Id.Equals(process.Id))))
  22. {
  23. MessageBox.Show("程序已打开,请查看任务栏图标或托盘处!");
  24. return;
  25. }
  26. #endregion
  27. //string password = "fu7vttF6y4uzdy5L";
  28. ////加密初始化向量
  29. //string iv = "2022090814:13:00";
  30. //string message = Tools.AESEncrypt("跑跑卡丁hell06661111111111111111", password, iv);
  31. //string str = message;
  32. //message = Tools.AESDecrypt("459HeKmnBgtP+ydiNOw/lP1mkffBqBCf57eHuVm8UHtWbUKOuLrZpXIrlsF6BQ4x", password, iv);
  33. //str = message;
  34. Application.Run(new Form1());
  35. }
  36. }
  37. }