Get system hard drives with C#

Retrieve the available disk drives with GetLogicalDrives function.

try
{
    foreach (String lodi in Environment.GetLogicalDrives())
        if (lodi != String.Empty)
            Console.WriteLine(lodi);
}
catch (Exception)
{
    //...
}
Categories: C# Tags: , , , , , ,
%d bloggers like this: