예제 #1
0
        private static void ArchiveOldLogsIfExist(object source, ElapsedEventArgs e)
        {
            LogsManager logManager       = new LogsManager();
            string      programDirectory = AppDomain.CurrentDomain.BaseDirectory;
            string      yesterday        = DateTime.Today.AddDays(-1).ToShortDateString();
            string      fileToCheckExist = programDirectory + "logs_" + yesterday + ".log";

            if (File.Exists(fileToCheckExist))
            {
                logManager.ArchiveOldLogsToZip();
                logManager.UploadOldLogsToFtp();
            }
        }
예제 #2
0
        public MainWindow()
        {
            try
            {
                InitializeComponent();
                textKontener.Text = contentProvider.GetPdfText("informacje_kzl.pdf");
                SetContent();

                LogsManager.TimerCheckForOldLogs();
                TimerUpdate();
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Problem z utworzeniem obiektu MainWindow");
            }
        }