我无法自定义我的石英日程安排,该日程安排每隔10分钟运行一次,除了周六和周日。
请告诉我如何自定义时间表,除了周六和周日,每天将在每10分钟触发一次?
public partial class QuartzTest : Form , IJob
{
IScheduler sched = null;
public QuartzTest()
{
InitializeComponent();
}
public void Execute(IJobExecutionContext context)
{
MessageBox.Show("job start");
}
private void QuartzTest_Load(object sender, EventArgs e)
{
// construct a scheduler factory
ISchedulerFactory schedFact = new StdSchedulerFactory();
// get a scheduler
sched = schedFact.GetScheduler();
sched.Start();
IJobDetail job = JobBuilder.Create<QuartzTest>()
.WithIdentity("myJob", "group1")
.Build();
ITrigger trigger = TriggerBuilder.Create()
.WithDailyTimeIntervalSchedule
(s =>
s.WithIntervalInHours(24)
.OnEveryDay()
.StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(19, 07))
)
.Build();
sched.ScheduleJob(job, trigger);
}
private void QuartzTest_FormClosing(object sender, FormClosingEventArgs e)
{
sched.Shutdown();
}
}
}
请告诉我如何提及每10分钟触发一次触发器,并且忽略周六和周日。请分享有助于我实现目标的示例。谢谢