Saber el Tamaño de Un Archivo con VB NET

Este ejemplo permite saber el tamaño de un archivo,ingresando la ruta del mismo.Usa como metodo La libreria Microsoft Scripting Runtime,que la tenes que agregar desde el menu Proyecto–>Añadir Referencias.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objFSO As Scripting.FileSystemObject
Dim objFile
objFSO = New Scripting.FileSystemObject
objFile = objFSO.GetFile("C:\teclas.zip")
MsgBox("El Archivo " & objFile.Name & ",Tiene un Tamaño de " & objFile.Size & " bytes", vbInformation + vbOKOnly, "Tamaño de archivo")
objFile = Nothing
objFSO = Nothing
End Sub

One Response to Saber el Tamaño de Un Archivo con VB NET

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>