在做
出现错误。
private static RikyasScheduler instance = new RikyasScheduler();
private Task<IScheduler> scheduler = null;
public RikyasScheduler()
{
scheduler = StdSchedulerFactory.GetDefaultScheduler();
}
#endregion
#region Methods
public void StartScheduler()
{
try
{
scheduler.Start();
}
catch (Exception ex)
{ }
}
public void StopScheduler()
{
try
{
scheduler.Shutdown();
}
catch (Exception ex)
{ }
}
public void AddJob(IJobDetail job, ITrigger trigger)
{
try
{
scheduler.ScheduleJob(job, trigger);
}
catch (Exception ex)
{ }
}
public void RemoveJob(string job, string group)
{
try
{
scheduler.DeleteJob(new JobKey(job, group));
}
catch (Exception ex)
{ }
}
答案 0 :(得分:0)
回答者:然后,您应该使用scheduler.Result获取实际的调度实例。 – Nilesh Shinde scheduler.Result.ScheduleJob(作业,触发器);