Use file filer on a directory : Directory : File Directory Stream C# Examples


C# Examples » File Directory Stream » Directory »

 

Use file filer on a directory









    
using  System;
using  System.IO;

static  class  MainClass
{
        static  void  Main(string[]  args)
        {
                DirectoryInfo  dir  =  new  DirectoryInfo("c:\\a");
                FileInfo[]  files  =  dir.GetFiles("*.gif");

                //  Display  the  name  of  all  the  files.
                foreach  (FileInfo  file  in  files)
                {
                        Console.Write("Name:  "  +  file.Name  +  "    ");
                        Console.WriteLine("Size:  "  +  file.Length.ToString());
                }

        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo File Directory Stream
» Directory