Program.cs 798 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Diagnostics;
  3. using System.ServiceProcess;
  4. using System.Windows.Forms;
  5. namespace JLHHJSvr
  6. {
  7. static class Program
  8. {
  9. /// <summary>
  10. /// 应用程序的主入口点。
  11. /// </summary>
  12. [STAThread]
  13. static void Main()
  14. {
  15. if (Environment.UserInteractive)
  16. {
  17. // 界面运行
  18. Application.EnableVisualStyles();
  19. Application.SetCompatibleTextRenderingDefault(false);
  20. Application.Run(new Form1());
  21. }
  22. else
  23. {
  24. ServiceBase[] ServicesToRun;
  25. ServicesToRun = new ServiceBase[] { new JLHHJSvr(), };
  26. ServiceBase.Run(ServicesToRun);
  27. }
  28. }
  29. }
  30. }