public RegularMailService() { InitializeComponent(); //初始化调度器工厂 ISchedulerFactory sf = SchedulerManager.GetSchedulerFactory(); //获取默认调度器 IScheduler scheduler = SchedulerManager.GetScheduler(); SchedulerManager.GetScheduler().AddGlobalJobListener(SchedulerManager.GetJobListener()); }
public Form1() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; //初始化调度器工厂 ISchedulerFactory sf = SchedulerManager.GetSchedulerFactory(); //获取默认调度器 IScheduler scheduler = SchedulerManager.GetScheduler(); //安装全局任务监视器 SchedulerManager.GetScheduler().AddGlobalJobListener(SchedulerManager.GetJobListener()); //启动调度器 scheduler.Start(); }