Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleFormat a number of bytes in KB, MB, and GB by using StrFormatByteSize
Description
Keywordsformat, bytes, KB, MB, GB, StrFormatByteSize
CategoriesAPI, Files and Directories
 
Use the StrFormatByteSize API function.
 
' Return a formatted string representing
' the number of bytes.
Private Function FormatBytes(ByVal num_bytes As Long) As _
    String
Dim txt As String

    txt = Space$(256)
    StrFormatByteSize num_bytes, txt, Len(txt)
    FormatBytes = Left$(txt, InStr(txt, vbNullChar) - 1)
End Function
 
See also:

 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated