using cuidian.Common; using Quartz; using Quartz.Impl; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TaskSchedule; namespace TimeSchedule { public class Time_U8_to_Wang { public static void GoU8_to_Wang() { ISchedulerFactory sf = new StdSchedulerFactory(); IScheduler scheduler = sf.GetScheduler(); //创建调度实例 //创建任务实例 IJobDetail job = JobBuilder.Create().WithIdentity(new JobKey("job1")).Build(); //创建触发器实例 ITrigger trigger = TriggerBuilder.Create().StartAt(DateTime.Now.AddSeconds(0)).WithCronSchedule(AppSeting.Instance.GetValue("U8_To_Wang")).Build(); scheduler.ScheduleJob(job, trigger); //绑定触发器和任务 scheduler.Start(); //启动监控 } //public static void GoEndU8_to_Wang() //{ // ISchedulerFactory sf = new StdSchedulerFactory(); // IScheduler scheduler = sf.GetScheduler(); //创建调度实例 // 创建任务实例 // IJobDetail job = JobBuilder.Create().WithIdentity(new JobKey("job2")).Build(); // 创建触发器实例 // ITrigger trigger = TriggerBuilder.Create().StartAt(DateTime.Now.AddSeconds(0)).WithCronSchedule(AppSeting.Instance.GetValue("U8_To_Wang")).Build(); // scheduler.ScheduleJob(job, trigger); //绑定触发器和任务 // scheduler.Start(); //启动监控 //} public static void GoWang_to_U8() { ISchedulerFactory sf = new StdSchedulerFactory(); IScheduler scheduler = sf.GetScheduler(); //创建调度实例 IJobDetail job = JobBuilder.Create().WithIdentity(new JobKey("job2")).Build(); //创建触发器实例"0 0 10 * * ? " ITrigger trigger = TriggerBuilder.Create().StartAt(DateTime.Now.AddSeconds(0)).WithCronSchedule(AppSeting.Instance.GetValue("Wang_To_U8")).Build(); scheduler.ScheduleJob(job, trigger); //绑定触发器和任务 scheduler.Start(); //启动监控 } //public static void GoWang_to_U8Two() //{ // ISchedulerFactory sf = new StdSchedulerFactory(); // IScheduler scheduler = sf.GetScheduler(); //创建调度实例 // IJobDetail job = JobBuilder.Create().WithIdentity(new JobKey("job3")).Build(); // //创建触发器实例"0 0 10 * * ? " // ITrigger trigger = TriggerBuilder.Create().StartAt(DateTime.Now.AddSeconds(0)).WithCronSchedule("0 0 2 * * ? ").Build(); // scheduler.ScheduleJob(job, trigger); //绑定触发器和任务 // scheduler.Start(); //启动监控 //} //public static void GoWang_to_U8Three() //{ // ISchedulerFactory sf = new StdSchedulerFactory(); // IScheduler scheduler = sf.GetScheduler(); //创建调度实例 // IJobDetail job = JobBuilder.Create().WithIdentity(new JobKey("job2")).Build(); // //创建触发器实例"0 0 10 * * ? " // ITrigger trigger = TriggerBuilder.Create().StartAt(DateTime.Now.AddSeconds(0)).WithCronSchedule("0 0 4 * * ? ").Build(); // scheduler.ScheduleJob(job, trigger); //绑定触发器和任务 // scheduler.Start(); //启动监控 //} //public static void GoEndWang_to_U8() //{ // ISchedulerFactory sf = new StdSchedulerFactory(); // IScheduler scheduler = sf.GetScheduler(); //创建调度实例 // //创建任务实例 // IJobDetail job = JobBuilder.Create().WithIdentity(new JobKey("job4")).Build(); // //创建触发器实例"0 0 0/4 * * ?" // ITrigger trigger = TriggerBuilder.Create().StartAt(DateTime.Now.AddSeconds(0)).WithCronSchedule(AppSeting.Instance.GetValue("Wang_To_U8")).Build(); // scheduler.ScheduleJob(job, trigger); //绑定触发器和任务 // scheduler.Start(); //启动监控 //} } }