Click here to Skip to main content
15,884,739 members
Articles / Programming Languages / Visual Basic

Print File Size

Rate me:
Please Sign up or sign in to vote.
3.50/5 (3 votes)
18 Jul 2010CPOL 13.8K   4  

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
19 Jul 2010DaveAuld
You can keep your output consistent with how Windows represents file sizes by using the inbuilt function;StrFormatByteSizeThe following code will dump the files from the root of C:\, Call getFilesAndSizes from a button click or wherever you want. ...
Please Sign up or sign in to vote.
18 Jul 2010SSDiver2112
Here is an alternate I like to use. Private Function TranslateFileSize(ByVal size As Double) As String Try Dim filesizename() As String = {" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"} Dim pow As Double = Math.Floor(Math.Log(size,...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Hong Kong Hong Kong
I loves Microsoft .NET.
I develop both windows and ASP.NET application using VB.NET and C#.

Comments and Discussions