Get the drives on this box : Environment : Development C# Examples


C# Examples » Development » Environment »

 

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]);
        }
}
    
   
  
   



Output

Drive 0 : C:\
Drive 1 : D:\


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Environment