Program.cs 782 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Configuration;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8. using System.Windows.Forms;
  9. namespace Pas.ScadaService
  10. {
  11. internal class Program
  12. {
  13. static void Main(string[] args)
  14. {
  15. Start();
  16. Application.Run();
  17. }
  18. private static void Start()
  19. {
  20. try
  21. {
  22. StartUp.Start();
  23. Console.WriteLine("启动成功");
  24. }
  25. catch (Exception e)
  26. {
  27. Console.WriteLine("出现异常3秒后自动重启,异常信息:"+e);
  28. Thread.Sleep(3000);
  29. Start();
  30. }
  31. }
  32. }
  33. }