public static void main() { ILogger theLogger = new LoggerNLog(); theLogger.Log("timer1_Tick: Start"); Settings theSettings = Settings.Get(); try { theLogger.Log("Forecast: Access"); theLogger.Log(theSettings.Forecast_Folder); DateTime currDate = DateTime.Now; string fileName = theSettings.Forecast_Folder + "\\" + currDate.ToString("yyyy_MM_dd") + "\\wrf-arw\\khv\\1AmurOs_HBRK15.txt"; theLogger.Log(fileName); theLogger.Log(Helper.readFileAsUtf8(fileName)); } catch (Exception ex) { theLogger.Error(ex.Message); theLogger.Error(ex.StackTrace); } finally { //timer1.Enabled = true; } }
private void timer1_Tick(object sender, EventArgs e) { timer1.Enabled = false; ILogger theLogger = new LoggerNLog(); theLogger.Log("timer1_Tick: Start"); Settings theSettings = Settings.Get(); IGroza theGroza = new GrozaFTP(theSettings.Groza_FTP_host, theSettings.Groza_FTP_user, theSettings.Groza_FTP_pass, theLogger); try { theLogger.Log("Groza: Access"); theGroza.Access(); } catch (Exception ex) { theLogger.Error(ex.Message); theLogger.Error(ex.StackTrace); } finally { timer1.Enabled = true; } }