By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,967 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,967 IT Pros & Developers. It's quick & easy.

Determining Size of a File

P: n/a
In VB.NET I find the IO object very handy in replacing most of the
functionality of the FileSystemObject. One exception, however, is in
determining the size of a file. How can you determine the size of a file in
VB.NET without adding the FileSystemObject to your project?
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The FileInfo class has a Length property.

Chris
"Phil Galey" <pa*****@starcalif.com.nospam> wrote in message
news:eG*************@tk2msftngp13.phx.gbl...
In VB.NET I find the IO object very handy in replacing most of the
functionality of the FileSystemObject. One exception, however, is in
determining the size of a file. How can you determine the size of a file in VB.NET without adding the FileSystemObject to your project?

Jul 21 '05 #2

P: n/a
Imports System.IO
....

Dim fi As New FileInfo(somepath)

Then get the information from the FileInfo object. In keeping with the
abstraction-of-the-month buzz, the property you want is "Length", not
"Size".
--
Klaus H. Probst, MVP
http://www.vbbox.com/


"Phil Galey" <pa*****@starcalif.com.nospam> wrote in message
news:eG*************@tk2msftngp13.phx.gbl...
In VB.NET I find the IO object very handy in replacing most of the
functionality of the FileSystemObject. One exception, however, is in
determining the size of a file. How can you determine the size of a file in VB.NET without adding the FileSystemObject to your project?

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.