系统相关
首页 > 系统相关> > Topshelf+Quartz实现windows任务

Topshelf+Quartz实现windows任务

作者:互联网

 

Topshelf使用示例,

HostFactory.Run(x =>
{
x.Service<QuartzStartup>(s =>
{

s.ConstructUsing(name => new QuartzStartup());
s.WhenStarted(tc => tc.Start());
s.WhenStopped(tc => tc.Stop());

});
x.RunAsLocalSystem();
x.StartAutomatically();
x.SetDescription("MCE定时任务处理");
x.SetDisplayName("MCE定时任务处理");
x.SetServiceName("MCETask");
});

最后通过cmd 运行 service.exe(service是对应的dll名称) install

 

标签:Quartz,service,windows,MCE,任务,Topshelf,定时,tc
来源: https://www.cnblogs.com/dongml/p/11800083.html