Visual Basic.NET - funciones de archivos

 
Vista:

funciones de archivos

Publicado por melli (5 intervenciones) el 18/08/2004 14:03:37
Hola, Necesito saber si hay alguna función para ficheros, que me diga fin de fichero y fin de línea como las que usamos por ejemplo en pascal eof(end of file) y eoln(end of line).
Lo que quiero hacer es que a partir de un fichero al que llamo fichero, quiero leer cada línea e introducirla en un array, y lo hace bien, pero no para porque no tengo la condición de fin de fichero.gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:funciones de archivos

Publicado por Edgar (1501 intervenciones) el 18/08/2004 14:37:09
Hola

Fijate en este ejemplo que conseguí en el msdn... a lo mejor te sirve

Try
' Create an instance of StreamReader to read from a file.
Dim sr As StreamReader = New StreamReader("TestFile.txt")
Dim line As String
' Read and display the lines from the file until the end
' of the file is reached.
Do
line = sr.ReadLine()
Console.WriteLine(Line)
Loop Until line Is Nothing
sr.Close()
Catch E As Exception
' Let the user know what went wrong.
Console.WriteLine("The file could not be read:")
Console.WriteLine(E.Message)
End Try

Saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar