Find Files That Match a Wildcard Expression : Directory : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » Directory »

 

Find Files That Match a Wildcard Expression








    
 

using System;
using System.IO;

public class WildcardTest {

    private static void Main(string[] args) {

        DirectoryInfo dir = new DirectoryInfo("c:\\");
        FileInfo[] files = dir.GetFiles("*");
            
        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# Source Code

 Navioo File Stream
» Directory