Stream C# Book

Here's how to use DirectoryInfo to enumerate files and subdirectories:
using System;
using System.IO;
using System.Linq;
using System.Text;
class Program
{
static void Main()
{
DirectoryInfo di = new DirectoryInfo(@"c:\photos");
foreach (FileInfo fi in di.GetFiles("*.jpg"))
Console.WriteLine(fi.Name);
foreach (DirectoryInfo subDir in di.GetDirectories())
Console.WriteLine(subDir.FullName);
}
}