增加定时任务
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using JY.Model;
|
||||
using JY.Model.Common;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace JY.Inspection
|
||||
{
|
||||
public partial class HomeForm
|
||||
{
|
||||
#region 定时任务
|
||||
TaskScheduler scheduler = null;
|
||||
private void InitTaskScheduler()
|
||||
{
|
||||
if (scheduler == null)
|
||||
{
|
||||
scheduler = new TaskScheduler();
|
||||
}
|
||||
|
||||
scheduler.AddTask(state => {
|
||||
Debug.WriteLine("Hello");
|
||||
}, interval: 1000 * 60);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user