25개 이상의 토픽을 선택하실 수 없습니다.
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();
- }
- }
- }
|