One of the most common task developers perform in everyday programming is to Working with the file system. This task includes navigating drives, folders and files and get some useful information for the front end application. System.IO namespace in .NET Framework 2.0 provides many classes to work with the file system. One of the class is DriveInfo class. This class represents a drive in the file system.
The following code demonstrates how you can get all the drives of the system using DriveInfo class static/shared method GetDrives() which returns an array of DriveInfo objects.
DriveInfo drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives)
Dim drives As DriveInfo() = DriveInfo.GetDrives()
For Each drive As DriveInfo In drives
If drive.IsReady Then