List directory under a directory : Directory : File Directory Stream C# Examples


C# Examples » File Directory Stream » Directory »

 

List directory under a directory









    
using  System;
using  System.IO;

public  class  MainClass
{
    static  void  Main(string[]  args)
    {
        DirectoryInfo  MyRoot  =  new  DirectoryInfo(@"c:\projects");

        DirectoryInfo[]  MySub  =  MyRoot.GetDirectories();
        foreach  (DirectoryInfo  D  in  MySub)
        {
            Console.WriteLine(D.Name);

        }

    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo File Directory Stream
» Directory