using System;
using System.IO;
staticclass MainClass
{
staticvoid 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());
}
}
}