lixiaojun
2024-04-26 8c17893ca9f35eb80b93b2cd2a850f9499a1ff8f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// 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();
//});
 
 
//SMI
HostFactory.Run(x =>
{
    x.Service<Service>();
    x.RunAsLocalSystem();
    x.SetDescription("智慧泵站Core版运行分析程序(SMI)");
    x.SetDisplayName("IStation.Core.Server.Run.SMI");
    x.SetServiceName("IStation.Core.Server.Run.SMI");
    x.EnableServiceRecovery(r => r.RestartService(TimeSpan.FromSeconds(120)));
    x.StartAutomatically();
});