protected override void OnStart(string[] args) { WorkHelper.Log("Service started"); WorkHelper.LogSysInfo(); _timer = new Timer { AutoReset = true, Interval = 1000 * 60 * 30, Enabled = true }; _timer.Elapsed += OnTimedEvent; }
protected override void OnStop() { WorkHelper.Log($"Service is stopped!"); }
private static void OnTimedEvent(object sender, ElapsedEventArgs e) { WorkHelper.LogSysInfo(); }