Thread: Get file size
View Single Post
Old 03-08-2014, 06:29 AM
Mike Mike is offline
Join Date: Apr 2001
Location: Montreal, Canada
Posts: 462
Default Get file size


I'm currently using the following to get the size of a file:

Dim infoReader As System.IO.FileInfo = My.Computer.FileSystem.GetFileInfo(TheFilePath)
lFileLength = CLng(infoReader.Length)
infoReader = Nothing
However, this procedure does not support IDisposable. Is there way of getting the filesize using something like FileStream or StreamReader instead which will support IDisposable?

Reply With Quote