Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
50 lines (49 loc) · 1.43 KB
/
Copy pathProgram.cs
File metadata and controls
50 lines (49 loc) · 1.43 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using Gravitybox.gFileSystem;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace Gravitybox.gFileSystem.Service
{
internal static class Program
{
private static void Main(string[] args)
{
if (args.Any(x => x == "-console" || x == "/console"))
{
try
{
var service = new PersistentService();
service.Start();
Console.WriteLine("Press <ENTER> to stop...");
Console.ReadLine();
service.Stop();
}
catch (Exception ex)
{
//LoggerCQ.LogError(ex, "Failed to start service from console.");
throw;
}
}
else
{
try
{
var servicesToRun = new ServiceBase[]
{
new PersistentService()
};
ServiceBase.Run(servicesToRun);
}
catch (Exception ex)
{
//LoggerCQ.LogError(ex, "Failed to start service.");
}
}
}
}
}