using System; using System.ServiceProcess; using FilterAPI; namespace FilterZone { internal class Program { public static String ZoneID; public static Authentication Auth; public static Database SQL; private static void Main() { if (Environment.UserInteractive) { Service s = new Service(); s.Init(true); // Init() is pretty much any code you would have in OnStart(). while (true) { Thread.Sleep(1); } } else { ServiceBase[] ServicesToRun = new ServiceBase[] { new Service() }; ServiceBase.Run(ServicesToRun); } }