Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/06/2011, 10:05
hunabku
 
Fecha de Ingreso: diciembre-2003
Mensajes: 595
Antigüedad: 20 años, 4 meses
Puntos: 1
Leer Multiple archivos Planos

Saludos a todos espero alguien me pueda ayudar algo actualmente leo un archivo plano y lo cargo en un gridview por medio del siguiente codigo:

List<string> lista = new List<string>();
DataRow fila;

string ruta;
ruta = @"C:\Archivo\datos1.txt";

StreamReader fic = new StreamReader(ruta);
string linea = null;
linea = fic.ReadLine();
while ((linea != null))
{
lista.Add(linea);
linea = fic.ReadLine();
}

string[] Datos;
for (int i = 0; i <= lista.Count - 1; i++)
{
Datos = lista[i].Split(MyChar2);

fila = tabla.NewRow();
for (int j = 0; j <= Datos.Length - 2; j++)
{
fila[j] = Datos[j].Trim();
}

tabla.Rows.Add(fila);

}
GridView2.DataSource = tabla;
GridView2.DataBind();

pero alguien sabe como poder leer N archivos que tenga en la carpeta Archivos