Log in

View Full Version : Get file size


albertkhor
11-18-2005, 06:04 AM
can someone teach me how to get file size (coding)?

Darius Wey
11-18-2005, 06:42 AM
If you open up File Explorer and to the top-right, enable Size from the drop-down menu, you will get a listing of file sizes.

Nurhisham Hussein
11-18-2005, 07:49 AM
Darius, he's talking about from a programming point of view....

GSmith
11-18-2005, 05:02 PM
In C#:

FileInfo fileinf = new FileInfo("\CF-Card\path\filename") ;
fileinf.Refresh() ; // necessary to get current length, otherwise information taken from last FileInfo request.
long fileSize = fileinf.Length ;

Darius Wey
11-19-2005, 03:14 AM
Darius, he's talking about from a programming point of view....

Yeah, that was after he edited his post. ;)

albertkhor
11-21-2005, 03:41 AM
Darius, he's talking about from a programming point of view....

Yeah, that was after he edited his post. ;)

Darius Wey, this is "Developer" forum! :oops:

Darius Wey
11-21-2005, 06:49 AM
Darius Wey, this is "Developer" forum! :oops:

I know. But I tend to take that with a grain of salt as there are usually quite a few users who make posts in the wrong forums. At the time, you asked what seemed to be a general question on file sizes, so I answered it as I saw fit.

As a tip, it's best to provide as much detail as possible in the subject header and original post.