using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.ServiceProcess; using System.Text; using System.Threading.Tasks; using log4net; namespace SendNSWMessageService { static class Program { /// /// The main entry point for the application. /// static void Main(string[] args) { ServiceBase[] ServicesToRun; log4net.Config.XmlConfigurator.Configure(); ServicesToRun = new ServiceBase[] { new NSWSendService() }; if (Debugger.IsAttached) { ((NSWSendService)ServicesToRun[0]).DoOnce(); } else if(args.Length > 0) { ((NSWSendService)ServicesToRun[0]).Commandline(args); } else { ServiceBase.Run(ServicesToRun); } } } }