static void Main(string[] args) { //Core.Classe.Coletor coletor = new Core.Classe.Coletor("http://globoesporte.globo.com/"); Core.Classe.Transformador transformador = new Transformador(); transformador.Iniciar(); Console.ReadKey(); }
private void timer_Elapsed(object sender, ElapsedEventArgs e) { try { if (!AindaExecutando) { AindaExecutando = true; Transformador transformador = new Transformador(); transformador.Iniciar(); } } catch (Exception ex) { StreamWriter vWriter = new StreamWriter(@"c:\transformadorTexto.txt", true); vWriter.WriteLine("Problema ao executar a rotina \n" + ex.Message + "\n\t" +ex.InnerException +" \n\t" +ex.StackTrace + "\n\t" + DateTime.Now.ToString()); vWriter.Flush(); vWriter.Close(); AindaExecutando = false; CriarTimer(); } }