1
我想給我的網站用戶發送生日短信。我使用石英進行調度,我寫了一些代碼,但除了它永久工作,但調度程序工作了幾次,然後停止。使用Quartz在asp.net和C中安排生日短信#
我不知道它是IIS服務器配置還是別的。
public class Global : System.Web.HttpApplication
{
public static void Start()
{
IScheduler scheduler = StdSchedulerFactory.GetDefaultScheduler();
scheduler.Start();
IJobDetail job = JobBuilder.Create<BirthdaySch>().Build();
ITrigger trigger = TriggerBuilder.Create()
.StartNow()
.WithSimpleSchedule(x => x
.WithIntervalInMinutes(1)
.RepeatForever())
.Build();
scheduler.ScheduleJob(job, trigger);
}
protected void Application_Start(object sender, EventArgs e)
{
Start();
}
protected void Session_Start(object sender, EventArgs e)
{
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
protected void Application_Error(object sender, EventArgs e)
{
}
protected void Session_End(object sender, EventArgs e)
{
}
protected void Application_End(object sender, EventArgs e)
{
}
}