protected override void OnStart(string[] args) { timer1 = new Timer(); this.timer1.Interval = 30000; this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Tick); timer1.Enabled = true; SampleLibrary.WriteErrorLog("service started"); }
protected override void OnStop() { timer1.Enabled = false; SampleLibrary.WriteErrorLog("service stopped"); }
private void timer1_Tick(object sender, ElapsedEventArgs e) { SampleLibrary.WriteErrorLog("Timer ticked and some job has been done successfully"); }