C# Schedule a window service -
I have a window service and I am using System.Timers.Timer To schedule service
protected override zero on start (string [] arg) {timer_ = new system. Timers Timer (Interval Time * 1000); Timer_.Elapsed + = New system. Timers.ElapsedEventHandler (TimerEvvant); Timer_.Enabled = true; } Private Zero Timer Event (Object Sender, System.Timers.ElapsedEventArgs e) {DoSth (); } I think that, the friendship () function does not work properly when I start the service, but intervalTimer seconds After that I want to run it properly after starting the service, so I friendship () statement timer_.Enabled = true; I call. But I have another problem which is not exactly the distance between the first and second process, interval , but the code does not have the basis at the processing time of DoSth () function. How can I solve it?
Comments
Post a Comment