How to: Determine a File's Size in Visual Basic
Thecan be used to get a object, which contains information about the specified file.
You can use the Length property to determine the size of the file in bytes.
The options available in dialog boxes, and the names and locations of menu commands you see, might differ from what is described in Help, depending on your active settings or edition. This Help page was written with General Development Settings in mind. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see.
To determine a file's size
Use the GetFileInfo method to return a FileInfo object for the file, which can be queried for information. This example gets a FileInfo object for Testfile.txt and uses the Length property to display the size of the file in bytes.