/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { // if we get "app" as command line argument then run this as standalone app instead of service (just for testing) if (args.Length > 0 && args[0] == "app") { BillingProcessor bp = new BillingProcessor(); bp.Initialize(); System.Windows.Forms.MessageBox.Show("Click OK to close this app"); bp.Dispose(); } else // Run as Windows Service { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new BillingService() }; ServiceBase.Run(ServicesToRun); } }
protected override void OnStart(string[] args) { _processor = new BillingProcessor(); _processor.Initialize(); }