using System;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
string[] files;
files =Directory.GetFiles("E:/pics/birthday-2014/");
Console.WriteLine("File Names:");
for (int i = 0; i < files.Length; i++)
{
Console.WriteLine("\t"+files[i]);
}
}
}
}
Program
Output
File Names: E:/pics/birthday-2014/IMG_20140814_212013.jpg E:/pics/birthday-2014/IMG_20140814_212204.jpg E:/pics/birthday-2014/IMG_20140814_212211.jpg E:/pics/birthday-2014/IMG_20140814_212219.jpg E:/pics/birthday-2014/IMG_20140814_212225.jpg E:/pics/birthday-2014/IMG_20140814_212229.jpg E:/pics/birthday-2014/IMG_20140814_212232.jpgNote: In above program, we need to remember, when we use "Directory" class, System.IO namespace must be included in the program.
need an explanation for this answer? contact us directly to get an explanation for this answer