I have created windows service. I need to run that automatically after 2 minutes. For that i have called System.Timers.Timer under OnStart and set the interval to 2 minutes (after converting from millseconds) and made than enabled as true
I have also made Timer Stopped and made that enabled as false in OnStop Method.
Is that ok or i’m missing anything? Let me know
thanks for your help!
you need to set
Timer.AutoReset=trueafterInitializedComponent()or in yourOnStartfunction before you setTimer.Enabled = trueand do remember you need to define your Timer in Class levelSee Timer.AutoReset Property