foreach (Volume v in new VolumeEnumerator())
{
Console.WriteLine("{0}, Free bytes available {1} Total Bytes {2}", v.Path,
v.FreeBytesAvailable, v.TotalNumberOfBytes);
}
This is all from building P/Invokes into the Volume Management API. If this isn't what you want, you'll likely find the specific information there.
First have something to represent a volume:
Next have a simple volume enumerator:
Finally example code to use it:
This is all from building P/Invokes into the Volume Management API. If this isn't what you want, you'll likely find the specific information there.