开发者

Run Windows Service after particular time

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

开发者_JS百科

thanks for your help!


you need to setTimer.AutoReset=true after InitializedComponent() or in your OnStart function before you set Timer.Enabled = true and do remember you need to define your Timer in Class level

See Timer.AutoReset Property

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜