码迷,mamicode.com
首页 > 其他好文 > 详细

Quartz 添加job执行

时间:2016-06-13 19:04:27      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:

private void ExecuteJob(int hour = 10, int min = 10, int ss = 0)
{
    ISchedulerFactory factory = new StdSchedulerFactory();
    IScheduler scheduler = factory.GetScheduler();
    scheduler.Start();

    IJobDetail jobDetail = JobBuilder.Create<ScheduleJob>().WithIdentity("dailyJob").Build();

    ITrigger trigger =
    TriggerBuilder.Create()
    .WithIdentity("jobTrigger")
    .WithSimpleSchedule(x => x.WithIntervalInHours(24).RepeatForever())
    .StartAt(DateBuilder.TodayAt(hour, min, ss))
    .Build();
    scheduler.ScheduleJob(jobDetail, trigger);
}

 

Quartz 添加job执行

标签:

原文地址:http://www.cnblogs.com/dennysong/p/5581573.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!