English 中文(简体)
Quartz.net[封闭式]简单工作例子
原标题:Simple, working example of Quartz.net [closed]

我们不准许对书籍、工具、软件图书馆以及更多的图书馆征求建议的问题。 你可以ed问这个问题,以便用事实和引言回答。

Closed 7 years ago.

I am looking for a working simple example of Quartz.net for Console application (it can be any other application as long as it simple enough...). And while I am there, is there any wrapper that could help me avoid implementing IJobDetail, ITrigger, etc.

问题回答

有一个伪装,与你完全一样,他发表了一个博客职位,其典型例子是Quartz.net Console的申请。

The following is a working Quartz.net example that is based against Quartz.net 2.0 (Latest). 这项工作是写出一个文字信息,即“就业”每5名未成年人在青少年中完成。

启动2012年视觉演播室项目。 。 页: 1

Requirements Download Quartz.NET assembly using NuGet. Right click on project, select “Manage Nuget Packages”. Then search for Quartz.NET. Once found select and install.

using System;
using System.Collections.Generic;
using Quartz;
using Quartz.Impl;
     
namespace Quartz1
{
    class Program
    {
        static void Main(string[] args)
        {
        // construct a scheduler factory
        ISchedulerFactory schedFact = new StdSchedulerFactory();
         
        // get a scheduler, start the schedular before triggers or anything else
        IScheduler sched = schedFact.GetScheduler();
        sched.Start();
         
        // create job
        IJobDetail job = JobBuilder.Create<SimpleJob>()
                .WithIdentity("job1", "group1")
                .Build();
         
        // create trigger
        ITrigger trigger = TriggerBuilder.Create()
            .WithIdentity("trigger1", "group1")
            .WithSimpleSchedule(x => x.WithIntervalInSeconds(5).RepeatForever())
            .Build();
         
        // Schedule the job using the job and trigger 
        sched.ScheduleJob(job, trigger);
         
        }
    }
     
    /// <summary>
    /// SimpleJOb is just a class that implements IJOB interface. It implements just one method, Execute method
    /// </summary>
    public class SimpleJob : IJob
    {
        void IJob.Execute(IJobExecutionContext context)
        {
        //throw new NotImplementedException();
        Console.WriteLine("Hello, JOb executed");
        }
    }
} 

Sources

在源代码中的文件和样本之间,应当有足够的时间开始。 页: 1 IJob在创造习俗工作时。 所有其他接口都已经为你安装,或者不需要在季茨.net进行基本使用。

to build up jobs and triggers to use the JobBuilder and TriggerBuilder helper objects.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签