by Peter Elisa Souhoka (21 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 17th July 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)
File Size
Private Sub cmdShowFileSize_Click()
Dim strOldFile As String
Dim strOldSize As String
Dim strMyDir As String
Dim strMyFile As String
strMyDir = "c:\windows\desktop"
strMyFile = "readme.txt"
strOldFile = strMyDir & "\" & strMyFile
strOldSize = FileLen(strOldFile)
lblFileSize.Caption = "The file " & strOldFile & " is " & _
Format(strOldSize, "#,##0") & " bytes in size."
End Sub