private static void CarregarContas() { using (LeitorDeArquivo leitor = new LeitorDeArquivo("teste.txt")) { leitor.LerProximaLinha(); } //------------------------------------------------------------------------- //LeitorDeArquivo leitor = null; //try //{ // leitor = new LeitorDeArquivo("contas.txt"); // leitor.LerProximaLinha(); // leitor.LerProximaLinha(); // leitor.LerProximaLinha(); // leitor.LerProximaLinha(); //} //finally //{ // if (leitor != null) // { // leitor.Fechar(); // } //} }
private static void CarregarContas() { using (LeitorDeArquivo leitor = new LeitorDeArquivo("teste.txt")) { leitor.LerProximaLinha(); } //LeitorDeArquivo leitor = null; //try { // leitor = new LeitorDeArquivo("contas.txt"); // leitor.LerProximaLinha(); //}finally { // if (leitor != null) { // leitor.Dispose(); // } //} }