Task Scheduler Quartz.net

Source: Internet
Author: User

1 usingQuartz;2 usingQuartz.impl;3 4Ischedulerfactory SF =NewStdschedulerfactory ();//5 PrivateIScheduler _tdata =SF. Getscheduler ();6Ijobdetail job1 = jobbuilder.create<timetask.electcalculate> (). Withidentity ("Job1","MyGroup"). Build ();//seconds, minutes, hours, days, months, years7Itrigger trigger1 = Triggerbuilder.create (). StartAt (DateTime.Now). Withcronschedule ("0 XX * *?"). Build ();//0 XX * *?//starts 00:10 every day.8 _tdata. Schedulejob (JOB1, trigger1);
 Public class electcalculate:ijob{private  electdata.electdata electdata;  Public void Execute (Ijobexecutioncontext context) {Data.Common.Set.LogManage.WriteInfoLog (DateTime.Now+" ) -------1 " );}}

/*
* Time is configured as follows: <value>0 * *?</value>
* Time size from small to large arrangement, starting from the second, order for seconds, minutes, hours, days, months, years * for any? is unrestricted. What is configured above is to start the Electcalculate () method at 16:26 per day

"0/10 * * * * *?" trigger every 10 seconds
"0 0 12 * *?" trigger 12 o'clock noon every day.
"0 15 10?" * * "trigger 10:15 every day"
"0 15 10 * *?" Daily 10:15 Trigger
"0 15 10 * *?" * "10:15 per day" trigger
"0 15 10 * *?" 2005 "2005-year daily 10:15 Trigger
"0 * 14 * *?" triggers every 1 minutes from 2 o'clock in the afternoon to 2:59 daily
"0 0/5 14 * *?" triggers every 5 minutes from 2 o'clock in the afternoon to 2:55 daily
"0 0/5 14,18 * *?" triggers every 5 minutes from 2 o'clock in the afternoon to 2:55 daily and from 6 o'clock in the afternoon to 6:55
"0 0-5 14 * *?" triggers every 1 minutes from 2 o'clock in the afternoon to 2:05 daily
"0 10,44 14?" 3 WED "2:10 and 2:44 triggers in Wednesday of every March
"0 15 10?" * Mon-fri "Monday to Friday 10:15 trigger
"0 15 10 15 *?" 15th 10:15 per month
"0 L *?" 10:15 on the last day of the month
"0 15 10?" * 6L "Last month of Friday 10:15 Trigger
"0 15 10?" * 6L 2002-2005 "2002 to 2005 the last of the monthly Friday 10:15 trigger
"0 15 10?" * 6#3 "Monthly third Friday 10:15 trigger
0 0 06,18 * *? Triggered at 6 o'clock in the morning and 6 o'clock in the afternoon every day
0 30 5 * *? * Triggered at 5:30 every day
0 0/3 * * *? Triggers every 3 minutes
0/20 * * * *? Every 20 seconds
*/

Task Scheduler Quartz.net

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.