Program.cs 848 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Linq;
  3. using System.Net;
  4. using System.Windows.Forms;
  5. namespace BsWidget
  6. {
  7. internal static class Program
  8. {
  9. internal static string Host = "127.0.0.1";
  10. internal static bool NoPerf = false;
  11. /// <summary>
  12. /// 应用程序的主入口点。
  13. /// </summary>
  14. [STAThread]
  15. private static void Main(string[] args)
  16. {
  17. if (args.Length > 0)
  18. {
  19. if (IPAddress.TryParse(args[0], out _))
  20. {
  21. Host = args[0];
  22. }
  23. }
  24. if (args.Any(p => p.ToLower() == "--no-perf")) NoPerf = true;
  25. Application.EnableVisualStyles();
  26. Application.SetCompatibleTextRenderingDefault(false);
  27. Application.Run(new MainForm());
  28. }
  29. }
  30. }