lixiaojun
2024-04-04 0dd540621753ff44fca56a253b681780100d8e4e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// See https://aka.ms/new-console-template for more information
using Yw.TopShelf;
using Topshelf;
 
//SZJT
HostFactory.Run(x =>
{
    x.Service<Service>();
    x.RunAsLocalSystem();
    x.SetDescription("智慧泵站Core版运行分析程序(SZJT)");
    x.SetDisplayName("IStation.Core.Server.Run.SZJT");
    x.SetServiceName("IStation.Core.Server.Run.SZJT");
    x.EnableServiceRecovery(r => r.RestartService(TimeSpan.FromSeconds(120)));
    x.StartAutomatically();
});