Search code examples
winformsbackgroundworker

Run a backgroundworker process every '5' minutes in Winforms


I have a Winforms app in which I want to run a background worker process every 5 minutes. I am using .Net 4.0.

Would this be possible with 'BackgoundWorker' component?


Solution

  • u can use C# Timer--->

    DispatcherTimer dispatcherTimer = new DispatcherTimer();
    dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
    TimeSpan interval = TimeSpan.FromMinutes(5);
    dispatcherTimer.Interval = interval;
    dispatcherTimer.Start();