If you’re curious about how query a drive and find out how much free space is left on it, in C#, there’s a conveniant DriveInfo class which exposes two properties for your usage: TotalFreeSpace and AvailableFreeSpace.
What’s the difference?
AvailableFreeSpace returns the amount of free space available given disk quotas. Yes, it’s true; apparently, every Windows OS since Windows 2000 implements and allows you to specify storage quotas.
TotalFreeSpace, on the other hand, just gives you the total amount of free space on the disk — just bear in mind that you may not be able to use all of it (depending on your user and permissions/quotas).