Get logical drives in C#

Directory.GetLogicalDrives method returns all logical drives on a system. Copy and paste this code and call this method.

/// <summary>

/// This method gets all logical drives on a system

/// </summary>

public void GetLogicalDrives()

{

    string[] drives = Directory.GetLogicalDrives();

    foreach (string str in drives)

    {

        System.Console.WriteLine(str);

    }          

}