Using Quartz.net to dynamically set timing time issues

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.