You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
- using System.ServiceProcess;
- using Hangfire;
-
- namespace Quanjiang.DigitalScholl.JobService
- {
- public partial class QuanjiangDigitalSchollJobService : ServiceBase
- {
- private BackgroundJobServer _server;
-
- public QuanjiangDigitalSchollJobService()
- {
- InitializeComponent();
- GlobalConfiguration.Configuration.UseSqlServerStorage("HangfireConnString");
- }
-
- protected override void OnStart(string[] args)
- {
- var options = new BackgroundJobServerOptions
- {
- ServerName = "QuanjiangDigitalSchollJobService"
- };
- _server = new BackgroundJobServer(options);
- //自动运行连接考勤机
- RecurringJob.Trigger("HKAttendance");
- }
-
- protected override void OnStop()
- {
- _server.Dispose();
- }
- }
- }
|