当前位置:
首页 > temp > 简明python教程 >
-
C#作业调度Quartz.NET学习笔记(2)
void Shutdown(bool isWaitForToComplete)
{
scheduler.Shutdown(isWaitForToComplete);
}
}
}
一行代码实现作业调度按钮代码:
/// <summary> /// 一行代码实现作业调度 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOneCode_Click(object sender, EventArgs e) { if (btnOneCode.Text == "一行代码实现作业调度") { string cronTime = "0/5 * * * * ?"; QuartzFactory.AddJob<TestJob>("TestJob", cronTime); btnOneCode.Text = "Stop"; } else { QuartzFactory.DeleteJob("TestJob"); btnOneCode.Text = "一行代码实现作业调度"; } }
参考自:
https://www.cnblogs.com/best/p/7658573.html