gpt4 book ai didi

c# - 如何在 Quartz.NET c# 中获取所有计划作业和触发器的详细信息

转载 作者:太空狗 更新时间:2023-10-29 19:52:05 25 4
gpt4 key购买 nike

我必须创建所有计划作业和触发器的管理页面。我如何获得在 Quartz.NET 中运行作业和触发器的详细信息?我可以暂停/停止或更新作业吗?有示例代码吗?

最佳答案

这是使用 StdSchedulerFactory 的方法

ISchedulerFactory schedFact = new StdSchedulerFactory();
foreach (IScheduler scheduler in schedFact.AllSchedulers)
{
var scheduler1 = scheduler;
foreach (var jobDetail in from jobGroupName in scheduler1.JobGroupNames
from jobName in scheduler1.GetJobNames(jobGroupName)
select scheduler1.GetJobDetail(jobName, jobGroupName))
{
//Get props about job from jobDetail
}

foreach (var triggerDetail in from triggerGroupName in scheduler1.TriggerGroupNames
from triggerName in scheduler1.GetTriggerNames(triggerGroupName)
select scheduler1.GetTrigger(triggerName, triggerGroupName))
{
//Get props about trigger from triggerDetail
}
}

关于c# - 如何在 Quartz.NET c# 中获取所有计划作业和触发器的详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6703384/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com