-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathProgram.cs
More file actions
31 lines (28 loc) · 914 Bytes
/
Copy pathProgram.cs
File metadata and controls
31 lines (28 loc) · 914 Bytes
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
29
30
31
using System.IO;
using Topshelf;
using WindowsServiceMonitor.ServerController;
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace WindowsServiceMonitor
{
class Program
{
static void Main(string[] args)
{
// change from service account's dir to more logical one
Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory);
HostFactory.Run(x =>
{
x.RunAsLocalSystem();
x.SetDescription("系统服务监控");
x.SetDisplayName("eWorldServerMonitor");
x.SetServiceName("eWorldServerMonitor");
x.Service(factory =>
{
MonitorServer server = new MonitorServer();
//server.Initialize();
return server;
});
});
}
}
}