using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Linq; using System.ServiceProcess; using System.Text; using System.Threading.Tasks; namespace MESDataExtractQuartz { public partial class Service1 : ServiceBase { public readonly Trigger Trigger; public Service1() { InitializeComponent(); Trigger = new Trigger(); } protected override void OnStart(string[] args) { Trigger.Run(); } protected override void OnStop() { Trigger.Stop(); } } }