lixiaojun
2022-08-17 d3024a7b50b35a8f24c1bfe0f13f4f86cc63a253
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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("智慧泵站数据处理程序");
    x.SetDisplayName("IStation.Core.Server.Handle");
    x.SetServiceName("IStation.Core.Server.Handle");
    x.EnableServiceRecovery(r => r.RestartService(TimeSpan.FromSeconds(120)));
    x.StartAutomatically();
 
 
});