git_bsmd/nsw/Source/SendNSWMessageService/Program.cs

42 lines
1.0 KiB
C#

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
{
/// <summary>
/// The main entry point for the application.
/// </summary>
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);
}
}
}
}