git_bsmd/SendNSWMessageService/Program.cs

36 lines
918 B
C#

using System.Diagnostics;
using System.ServiceProcess;
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();
}
else
{
ServiceBase.Run(ServicesToRun);
}
}
}
}