How to get the computer logical drives in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] arr = Environment.GetLogicalDrives();

            Console.WriteLine(string.Join("\n", arr));
        }
    }
}

/*
run:
  
C:\
D:\
E:\
F:\

*/

 



answered Jan 13, 2017 by avibootz

Related questions

1 answer 276 views
1 answer 264 views
1 answer 247 views
1 answer 292 views
1 answer 246 views
1 answer 207 views
207 views asked Aug 11, 2023 by avibootz
...