public EDCAgentService() { int port = int.Parse(ConfigurationManager.AppSettings[kConfKeyListenPort]); string connectString = ConfigurationManager.AppSettings[kConfKeyConnectionString]; string logConfFile = ConfigurationManager.AppSettings[kConfKeyLog4NetConfFile]; InitializeComponent(); logger = new EDCLogger.EDCLogger(kModuleName, logConfFile); agent = new EDCAgent(logger, port, connectString); logger.Info("EDCAgentService Initialized"); }
//[DllImport("Kernel32")] //public static extern bool SetConsoleCtrlHandler(HandlerRoutine Handler, bool Add); static void Main(string[] args) { ConsoleKeyInfo ck1; Console.CancelKeyPress += new ConsoleCancelEventHandler(stop); int port = int.Parse(ConfigurationManager.AppSettings[kConfKeyListenPort]); string connectString = ConfigurationManager.AppSettings[kConfKeyConnectionString]; string logConfFile = ConfigurationManager.AppSettings[kConfKeyLog4NetConfFile]; System.Diagnostics.EventLog eventLog = new EventLog(); EDCLogger.EDCLogger logger = new EDCLogger.EDCLogger(kModuleName, logConfFile); agent = new EDCAgent(logger, port, connectString); agent.Start(); }