Quartz.NET 快速入门
官网: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");
}
}
}
Quartz.NET 快速入门的更多相关文章
- Quartz任务调度快速入门
Quartz任务调度快速入门 概述 了解Quartz体系结构 Quartz对任务调度的领域问题进行了高度的抽象,提出了调度器.任务和触发器这3个核心的概念,并在org.quartz通过接口和类对重要的 ...
- Quartz.NET快速入门指南
最近,在工作中遇到了 Quartz.net 这个组件,为了更好的理解项目代码的来龙去脉,于是决定好好的研究一下这个东西.确实是好东西,既然是好东西,我就拿出来分享一下.万丈高楼平地起,我们也从入门开始 ...
- Java学习---Quartz定时任务快速入门
Quartz是OpenSymphony开源组织在Job scheduling领域又一个开源项目,它可以与J2EE与J2SE应用程序相结合也可以单独使用.Quartz可以用来创建简单或为运行十个,百个, ...
- Quartz任务调度快速入门(转)
转自http://www.blogjava.net/baoyaer/articles/155645.html 概述 了解Quartz体系结构 Quartz对任务调度的领域问题进行了高度的抽象,提出了调 ...
- Quartz任务调度快速入门(转)
概述 了解Quartz体系结构 Quartz对任务调度的领域问题进行了高度的抽象,提出了调度器.任务和触发器这3个核心的概念,并在org.quartz通过接口和类对重要的这些核心概念进行描述: ●Jo ...
- Quartz教程:快速入门
原文链接 | 译文链接 | 翻译:nkcoder | 校对:方腾飞 本系列教程由quartz-2.2.x官方文档翻译.整理而来,希望给同样对quartz感兴趣的朋友一些参考和帮助,有任何不当或错误之处 ...
- Quartz应用实践入门案例一(基于Web环境)
Quartz是一个完全由java编写的开源作业调度框架,正是因为这个框架整合了许多额外的功能,所以在使用上就显得相当容易.只是需要简单的配置一下就能轻松的使用任务调度了.在Quartz中,真正执行的j ...
- quartz-2.2.x 快速入门 (1)
欢迎来到quartz快速入门教程.阅读本教程,你将会了解: quartz下载 quartz安装 根据你的需要,配置Quartz 开始一个示例应用 当熟悉了quratz调度的基本功能后,可以尝试一些 ...
- Spring总结一:Srping快速入门
Sping是什么: Spring是一个开放源代码的设计层面框架,他解决的是业务逻辑层和其他各层的松耦合问题,因此它将面向接口的编程思想贯穿整个系统应用.Spring是于2003 年兴起的一个轻量级的J ...
随机推荐
- iOS React Native 环境的搭建
react native 的官网:http://reactnative.cn/docs/0.47/getting-started.html#content --iOS如何搭建mac版的环境 1.配置 ...
- 动态规划:HDU1087Super Jumping! Jumping! Jumping!(最大上升和)
Problem Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very ...
- Permutation Sequence(超时,排列问题)
The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the p ...
- [Bzoj4722]由乃(线段树好题)(倍增处理模数小快速幂)
4722: 由乃 Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 360 Solved: 131[Submit][Status][Discuss] D ...
- MySQL中的数据类型的长度范围和显示宽度(转)
长度范围是随数据类型就已经是固定的值,而显示宽度与长度范围无关. 以下是每个整数类型的存储和范围(来自MySQL手册) 类型 字节 最小值 最大值 (带符号的/无符号的) (带符号的/无符号的) TI ...
- 【Nginx】http模块的数据结构
定义fttp模块方式很简单,比如:ngx_module_t ngx_http_mytest_module; 其中,ngx_module_t是一个Nginx模块的数据结构. typedef struct ...
- [Angular] Communicate Between Components Using Angular Dependency Injection
Allow more than one child component of the same type. Allow child components to be placed within the ...
- Office EXCEL 2010如何取消宏密码保护
打开宏编辑器之后,右击VBA项目,然后属性,保护中去掉密码即可
- FZU 2150 Fire Game (暴力BFS)
[题目链接]click here~~ [题目大意]: 两个熊孩子要把一个正方形上的草都给烧掉,他俩同一时候放火烧.烧第一块的时候是不花时间的.每一块着火的都能够在下一秒烧向上下左右四块#代表草地,.代 ...
- 使用7zip压解各种文件的经常使用命令
7zip简单介绍 格式支持 压缩解压缩 仅支持解压缩 安装 Debian Ubuntu ArchLinux 使用 打包 解压 列出文件的信息列表 检查包的完整性 更新压缩包 删除包里的文件 7zip简 ...