Service1.cs 674 B

123456789101112131415161718192021222324252627282930313233
  1. 
  2. using System.ServiceProcess;
  3. using PLC_S;
  4. namespace PLC_WS
  5. {
  6. public partial class Service1 : ServiceBase
  7. {
  8. public Service1()
  9. {
  10. InitializeComponent();
  11. }
  12. protected override void OnStart(string[] args)
  13. {
  14. //if (args.IsNullOrEmpty())
  15. //{
  16. // Logger.Debug("Service1 args is null");
  17. //}
  18. //else
  19. //{
  20. // Logger.Debug("Service1 args is " + JsonHelper.FromObject(args));
  21. //}
  22. PLC_Server.Start();
  23. }
  24. protected override void OnStop()
  25. {
  26. PLC_Server.Stop();
  27. }
  28. }
  29. }