123456789101112131415161718192021222324252627282930313233343536 |
- using RDIFramework.Utilities;
- using System;
- using System.Configuration;
- using System.IO;
- using Topshelf;
- namespace TimedUpload
- {
- class Program
- {
- private static string ServiceName = ConfigurationManager.AppSettings["ServiceName"];
- static void Main(string[] args)
- {
- log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config"));
- try
- {
- HostFactory.Run(x =>
- {
- x.UseLog4Net();
- x.Service<ServiceRunner>();
- x.SetDescription(ServiceName);
- x.SetDisplayName(ServiceName);
- x.SetServiceName(ServiceName);
- x.EnablePauseAndContinue();
- });
- }
- catch (Exception ex)
- {
- }
-
- }
- }
- }
|