Subject: First hand on Implementation of Quartz.Net
post you can see that Quarz.Net is really
powerful scheduling jobs system. This tutorial shows you how to develop a
schedule a job using quartz. I have
created the simple CSharp example of execute the job which is basically sending
the email. Just follow this steps are you are done.
Download the Quartz
library from official website.
You need to add
necessary references. It is available under the bin folder.
I have created
sample application using Visual Studio 2012. I’ve set the target framework as
.Net Framework 4.
File Name: SendEmail.cs
This class file is
responsible for what need to be done. I have created class “SendMail” which is
responsible for sending email. You can see SendEmail class has implemented IJob
3. Quartz Trigger
It is necessary to define the timings to
execute the jobs. I have created a simple job which is sending email. It will
execute at every midnight at 12.30. You will found the cron trigger example
from their official site. See this page for more examples. (http://quartznet.sourceforge.net/tutorial/lesson_6.html)
If you have any confusing cron just let me know. I am there for you. J
Now it’s time to start the wheel. Let’s
turn it on. This piece of code is responsible for start the scheduler to these
kind bulky jobs.
5. Full Example
You can see the
full source code of file. Just place the code like these and all the things
this is very small thing to write. Now Hit the F5 button and get relaxed. J