//#define DEPLOY using System; using System.Collections.Generic; using System.Linq; using System.ServiceProcess; using System.Text; using System.Reflection; using Quartz; using Quartz.Impl; namespace SiaSun.LMS.WinService { static class Program { public static string _BaseUrl = string.Empty; public static log4net.ILog sysLog = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); static ISchedulerFactory schedulerFactory = new StdSchedulerFactory(); static IScheduler scheduler; /// /// 应用程序的主入口点。 /// static void Main() { #if DEPLOY ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new WMSService() }; ServiceBase.Run(ServicesToRun); #else try { Program._BaseUrl = SiaSun.LMS.Common.StringUtil.GetConfig("SiaSunSrvUrl"); ServiceHostGroup.StartAllConfiguredServices(); scheduler = schedulerFactory.GetScheduler(); scheduler.Start(); } catch (Exception ex) { sysLog.Fatal("系统异常", ex); } #endif } } }