Follow these steps
  1. Add a first reference of Quartz.dll in your web application.
  2. Create a function which you want to execute repeatedly on a scheduled time.

    Call the created function in same class

    example
    1. public void Execute(IJobExecutionContext context) {
    2. this.ScheduledTask();
    3. }
  3. Create a job (ex:name JobScheduler)(Function).

    example
    1. public static void Start() {
    2. // define the job and tie it to our HelloJob class
    3. IJobDetail job = JobBuilder.Create < EmailJob > ()
    4. .WithIdentity("myJob", "group1") // name "myJob", group "group1"
    5. .Build();
    6. // Trigger the job to run now, and then every 40 seconds
    7. ITrigger trigger = TriggerBuilder.Create()
    8. .WithIdentity("myTrigger", "group1")
    9. .StartNow()
    10. .WithSimpleSchedule(x => x
    11. //.WithIntervalInSeconds(300)
    12. .WithIntervalInMinutes(20)
    13. .RepeatForever())
    14. .Build();
    15. // Tell quartz to schedule the job using our trigger
    16. ISchedulerFactory sf = new StdSchedulerFactory();
    17. IScheduler sc = sf.GetScheduler();
    18. sc.ScheduleJob(job, trigger);
    19. sc.Start();
    20. }
  4. Add Global.asax.
    1. protected void Application_Start(object sender, EventArgs e) {
    2. JobScheduler.Start();
    3. }
That's it. Now, when you execute this code, the function will work repeatedly on the scheduled time.