You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
719 B
C#

using Quartz;
using System;
using System.Configuration;
using System.Threading.Tasks;
using ZJ_BYD.DB;
using ZJ_BYD.Untils;
namespace ZJ_BYD
{
public class MyJob : IJob
{
private static string period = ConfigurationManager.AppSettings["period"];
public Task Execute(IJobExecutionContext context)
{
int.TryParse(period, out int iPeriod);
LogHelper.WriteLog(string.Format("于{0}触发了定时任务!", DateTime.Now));
var beginTime = $"{DateTime.Now.AddYears(iPeriod * -1):yyyy-MM-dd} 00:00:00";
ResultHelper.DelResult(DateTime.Parse(beginTime));
MskCodeHelper.delPrintInfo();
return null;
}
}
}