示例#1
0
 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");
 }
示例#2
0
 protected override void OnStop()
 {
     timer1.Enabled = false;
     SampleLibrary.WriteErrorLog("service stopped");
 }
示例#3
0
 private void timer1_Tick(object sender, ElapsedEventArgs e)
 {
     SampleLibrary.WriteErrorLog("Timer ticked and some job has been done successfully");
 }