Mega Code Archive

 
Categories / C# Tutorial / Development
 

Get the drives on this box

using System; class MainClass {     public static void Main(string[] args)     {       string[] drives = Environment.GetLogicalDrives();       for(int i = 0; i < drives.Length; i++)         Console.WriteLine("Drive {0} : {1}",  i, drives[i]);     } } Drive 0 : C:\ Drive 1 : D:\