[.Net] 현재 디렉토리의 파일 리스트 보여주기

using System;
using System.IO;

class csDir
{
        public static void Main (String[] args)
        {
                DirectoryInfo dir = new DirectoryInfo (".");
                Console.WriteLine ("\n 현재 디렉토리는 {0} 입니다.", dir.FullName);
                Console.WriteLine
                  ("========================================================\n");

                foreach (FileInfo f in dir.GetFiles ("*.*"))
                {
                        String name = f.Name;
                        long size = f.Length;
                        DateTime creationTime = f.CreationTime;
               
                        Console.WriteLine ("{0, -12:N0} {1, -20:g} {2}",size, creationTime, name);
                }
        }
}

가장 많이 본 글