我必须在隔天使用自定义计时器作业执行一些操作吗? 下面创建和启动计时器作业(在功能接收器中)的代码,但它每天运行,我必须隔天运行它?
怎么做?
private bool CreateJob(SPSite site) { bool jobCreated = false; 尝试 {
TimerJob job = new TimerJob(JobName, site.WebApplication);
job.Title = JobName;
SPMinuteSchedule schedule = new SPMinuteSchedule();
schedule.BeginSecond = 0;
schedule.EndSecond = 59;
schedule.Interval = 15;
job.Schedule = schedule;
job.Update();
}
catch (Exception)
{
return jobCreated;
}
return jobCreated;
}