Pregunta: | 39465 - COMO OBTENER EL TAMAÑO DE UN FICHERO |
Autor: | Rafael Rafael |
Quisiera saber como obtener el tamaño de un Fichero en VisualBasic Net.
Gracias |
Respuesta: | Tomás Abad |
Imports System
Imports System.IO Public Module modmain Sub Main() Dim MyFile as new FileInfo ("c:autoexec.bat") Console.WriteLine("The length of autoexec.bat is " + MyFile.Length.ToString + " bytes.") End Sub End Module MAS CODIGOS EN: http://webcindario.com/argayo |
Respuesta: | JOSE MARIA AVILA S. |
Para ello tenemos que utilizar la clase FileInfo, dicha clase incorpora la propiedad Length que devuelve el tamaño en bytes del archivo representado por el objeto FileInfo. La clase File no tiene ninguna propiedad similar. Saludos, JmaS |