Reescribir un archivo de texto en C# 26 Julio 2008
Posted by joelperez in Microsoft, Programacion.Tags: C#, TextReader, TextWriter
trackback
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
namespace JoelTextReWriter
{
class Program
{
static void Main(string[] args)
{
string Linea = “”;
using (StreamWriter sw = new StreamWriter(“archivo_destino.txt”))
{
TextReader tr = new StreamReader(“archivo_origen.txt”);
while ((Linea = tr.ReadLine()) != null)
{
Console.WriteLine(Linea);
sw.WriteLine(Linea);
}
tr.Close();
}
}
}
}
Comentarios»
No comments yet — be the first.