Home

VB.NET Format File Size

Posted by SteveHardie | On: Oct 07 2009 | Comments (1)
Format a large integer (long) that represents a file size in bytes to a more readable string representation that includes Kb, Mb and Gb. Public Shared Function FormatFileSize(ByVal FileSizeBytes As Long) As String Dim sizeTypes() As String = {"b",...

VB.NET Finding a File Size

Posted by SteveHardie | On: Oct 07 2009 | Comments (0)
There may be some situations where you would like to retrieve the size of a given file. Below is a quick piece of code that will do exactly that. It will return the size of the file in bytes. Imports System.IO Private Function GetFileSize(ByVal MyFilePath As String)...