代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.ServiceProcess; using System.Text; using GlobalLink.Common; using System.Data.SqlClient;
namespace billService { public partial class billService : ServiceBase { public billService() { InitializeComponent(); }
protected override void OnStart(string[] args) { if (this.timer1 != null) { timer1 = new System.Timers.Timer(); this.timer1.Interval = 5000; this.timer1.Enabled = true; this.timer1.Start(); this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(timer1_Elapsed); } }