How to read the logical and physical file size using C# api.
(new FileInfo(path).Length)
is the actual size. As for size on disk, I don't think there's an API to get it, but you can get it using the actual size, and the cluster size.
There's some info on the calculation required here: http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/85bf76ac-a254-41d4-a3d7-e7803c8d9bc3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With