duheng
2024-09-27 a4cea96ee3f73c627a36a7704d0582903a8f76b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// See https://aka.ms/new-console-template for more information
using IStation.TopShelf;
using Topshelf;
 
 
 
 
HostFactory.Run(x =>
{
    x.Service<Service>();
    x.RunAsLocalSystem();
    x.SetDescription("智慧泵站Core版服务程序(PHM)");
    x.SetDisplayName("IStation.Core.Server.PHM");
    x.SetServiceName("IStation.Core.Server.PHM");
    x.EnableServiceRecovery(r => r.RestartService(TimeSpan.FromSeconds(120)));
    x.StartAutomatically();
 
 
});