(Sorry for the previous answer with 1024, erroneous assumption)
To your question about converting from kB to MB, you can certainly assume according to the SI standard:
1 MB = 1000 kB
Ergo, divide by 1000.
For the unconvinced, I recommend that you read this .
Since software such as Microsoft Windows expresses the storage amount in multiples of 1024 bytes, change your code to:
dblMax = dblMax/(1024*1024) MessageBox.Show("Largest file in .Net folder is " & vbCrLf & strMax & vbCrLf & dblMax.ToString("N0"))
(since you print dblMax and your file size is in bytes, not kB)
user191776
source share