You are on page 1of 1

using

using
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Threading.Tasks;
System.IO;

namespace ConsoleApplication28
{
class Program
{
static void Main(string[] args)
{
carga_documento(0, 2,ConsoleColor.DarkRed,"caratula.txt");
}
static void carga_documento(int fila, int columna, ConsoleColor color, s
tring nombre)
{
string linea;//para capturar la linea q estoy hacendo
Console.ForegroundColor = color;//q color le pongo desde hay en adel
ante
try
{
StreamReader str = new StreamReader(nombre);
linea = str.ReadLine();
while (linea != null)
{
Console.SetCursorPosition(columna , fila );
Console.WriteLine(linea);
linea = str.ReadLine();
fila = fila + 1;
}
str.Close();
//q pasa linea a linea
}
catch
{
Console.WriteLine("error al cargar el archibo");
}
Console.ReadKey();
}
}
}

You might also like