-1
我有一个Winforms应用程序,我想每5分钟运行一次后台工作进程。我正在使用.Net 4.0。在Winforms中每运行一个'5'分钟运行一个backgroundworker进程
'BackgoundWorker'组件可以吗? ?
我有一个Winforms应用程序,我想每5分钟运行一次后台工作进程。我正在使用.Net 4.0。在Winforms中每运行一个'5'分钟运行一个backgroundworker进程
'BackgoundWorker'组件可以吗? ?
u可以使用C#定时器--->
DispatcherTimer dispatcherTimer = new DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
TimeSpan interval = TimeSpan.FromMinutes(5);
dispatcherTimer.Interval = interval;
dispatcherTimer.Start();
使用的WinForms计时器对象与DispatcherTimer可能会更好,所以如果他没有使用它,他就不会吸引WPF。 –
你可以检查此http://stackoverflow.com/questions/1241618/backgroundworker-thread-and-timer-logic –