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

Hi,

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

Code:
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?

Thanks!
Reply With Quote