官网:http://www.quartz-scheduler.net/

API:http://www.quartz-scheduler.net/documentation/index.html

快速入门:http://www.quartz-scheduler.net/documentation/quartz-2.x/quick-start.html

其他资料:

C# 定时任务 调度框架 WebWork (Quartz.NET) Web版的Windows服务

http://blog.csdn.net/gavin_luo/article/details/12758973

Quartz.net 动态调整任务的调度时间

http://blog.csdn.net/huanglan513/article/details/8935721

一个简单的快速入门示例

using Quartz.Impl;
using System;
using Quartz;
using System.Threading; namespace QuartzTest1
{
class Program
{
static void Main(string[] args)
{
try
{
Common.Logging.LogManager.Adapter = new Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter {Level = Common.Logging.LogLevel.Info}; // Grab the Scheduler instance from the Factory //从工厂的实例中获取 调度程序
IScheduler scheduler = StdSchedulerFactory.GetDefaultScheduler(); // and start it off
scheduler.Start();//启用调度程序 // define the job and tie it to our HelloJob class定义一个job把它交给 HelloJob的类
IJobDetail job = JobBuilder.Create<HelloJob>()
.WithIdentity("job1", "group1") //job的名称 和 job所在的组
.Build();//创建这个job // Trigger the job to run now, and then repeat every 10 seconds //现在就触发这个job,并没隔10秒重复
ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("trigger1", "group1")//触发器 名称和 组
.StartNow()
.WithSimpleSchedule(x => x
.WithIntervalInSeconds() //这里参数为”秒“
.RepeatForever())
.Build(); // Tell quartz to schedule the job using our trigger
scheduler.ScheduleJob(job, trigger);//通知到quarts 调度这个job用触发器 // some sleep to show what's happening
//Thread.Sleep(TimeSpan.FromSeconds(60)); // and last shut down the scheduler when you are ready to close your program
//scheduler.Shutdown();//关闭调度
}
catch (SchedulerException se)
{
Console.WriteLine("错误日志:"+se);
} //Console.WriteLine("Press any key to close the application");
//Console.ReadKey(); }
} public class HelloJob : IJob
{
public void Execute(IJobExecutionContext context)
{
Console.WriteLine("Greetings from HelloJob!-wjw");
}
}
}

最新文章

  1. python下编译py成pyc和pyo
  2. java 创建string对象机制 字符串缓冲池 字符串拼接机制
  3. Ubuntu nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
  4. search in 2d matrix and serach minimum in rotated array
  5. 有趣的insert死锁
  6. Vim 保存和退出命令
  7. javaweb学习总结九(xml解析以及调整JVM内存大小)
  8. JavaScript 应用开发 #4:切换任务的完成状态
  9. winfrom 截屏、抓屏 分类: WinForm 2014-08-01 13:02 198人阅读 评论(0) 收藏
  10. SQL Server 2008 批量插入数据时报错
  11. FFT算法的完整DSP实现(转)
  12. JAVA课程设计个人博客 学生成绩管理 201521145048 林健
  13. JDFS:一款分布式文件管理系统,第五篇(整体架构描述)
  14. 负载均衡器之 Haproxy
  15. The correct way to initialize a dynamic pointer to a multidimensional array
  16. react事件中的事件对象和常见事件
  17. MySQL更新优化(转)
  18. 35、输入框(UITextField)密码明暗文切换
  19. HBase启动时报错:/bin/java: No such file or directory6/bin/../bin/hbase: line 412: /usr/local/jdk1.8.0_152/bin/java
  20. Security5:授予权限

热门文章

  1. Java开发笔记(一百)线程同步synchronized
  2. 【永久激活,视频教程,超级详细】IntelliJ idea 2018.3安装+激活+汉化
  3. Spring Boot使用MyBatis 3打印SQL的配置
  4. oracle字段的所有类型
  5. linux的shell的until循环举例说明
  6. OpenWrt 安装python-sqlite3失败
  7. ffm算法
  8. 【scrapy】Item Pipeline
  9. discuz的php7版本号
  10. iOS xmpp的使用