There is no need to explain the use of quartz.net.
In response to customer demand issues. Need to do an interface to set the timing time. So I am in Baidu A. Use the Cronexpression class to set the time ...
I know this class has a well-defined field. I don't know if it's the wrong way. I didn't find it anyway.
So that's what I did.
/// <summary> ///Timing Method/// </summary> /// <param name= "Week" >days</param> /// <param name= "Hour" >when</param> /// <param name= "Minute" >points</param> Private voidTiming (stringWeekstringHourstringminute) {IScheduler sched1; Ischedulerfactory SF1=Newstdschedulerfactory (); Sched1=SF1. Getscheduler (); Jobkey Jobkey1=NewJobkey ("Myjob1","Mygroup1"); Ijobdetail Job1= jobbuilder.create<webdemo.quartz>(). Withidentity (Jobkey1). Build (); stringt =""; if(Week = ="*") { //Dailyt ="0"+ Minute +" "+ Hour +" ? * *";//at some point in 0 seconds a day. } Else { //One dayt ="0"+ Minute +" "+ Hour +" ? * "+ Week;//One day at a time, 0 seconds a minute.} cronexpression Cron=Newcronexpression (t); Ioperabletrigger Trigger1=NewCrontriggerimpl ("trigName1","GROUP12", Cron. cronexpressionstring); Sched1. Schedulejob (JOB1, trigger1); Sched1. Start (); }
And then it's OK. Hey..
Using Quartz.net to dynamically set timing time issues