Quatrz定时任务job实现using Quartz;
using Quartz.Impl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DriverWWM
{
static class Program
{
/// <summary>
/// 应用程序的主入口点
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
FrmLogIn frm = new FrmLogIn();
frm.ControlBox = false;
Application.Run(frm);
if (frm.DialogResult == DialogResult.OK)
{
frm.Close();
//启动线程
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
IScheduler scheduler = schedulerFactory.GetScheduler();
scheduler.Start();
Console.Read();
Application.Run(new FrmMain());
scheduler.Shutdown();
}
}
}
}
评论