Visual Basic doesn’t provide much help in the simple task of analyzing the disk drives in the system, but fortunately, the Windows API does have some functions. GetDriveType, GetDiskFreeSpace, and GetVolumeInformation provide the information but, like most Win32 functions, they’re oriented toward C programmers, not Visual Basic programmers.
Let’s turn those Win32 functions into a Visual Basic-friendly class. Our drive objects won’t simply get information about drives—they will be drives, telling the user everything about the physical drives the objects represent.