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 155 views
1 answer 161 views
1 answer 166 views
1 answer 197 views
1 answer 153 views
1 answer 127 views
127 views asked Aug 11, 2023 by avibootz
...