Hi guys,
I need a bit of help on finding out how to calculate file/folder sizes :)
So thats my current code. It perfectly calculates the "size" of the folder. However, what i'm really after, is the "size on disk" property, as it appears under the folder's properties.
You can see the massive difference in the picture below.
![Name: cropn.png
Views: 51
Size: 4.2 KB]()
Any help in finding the size on disk would be great :)
Thanks!
I need a bit of help on finding out how to calculate file/folder sizes :)
Code:
Dim fileSize As Long = 0
'Dim drInfo As New DirectoryInfo("C:\some\random\folder")
Dim filesInfo() As FileInfo = drInfo.GetFiles("*.*", SearchOption.AllDirectories)
For Each fileInfo As FileInfo In filesInfo
fileSize += fileInfo.Length
Next
You can see the massive difference in the picture below.
Any help in finding the size on disk would be great :)
Thanks!