static void Main(string[] args) { DirectoryInfo di = new DirectoryInfo(@"E:\Work\Demo"); FindFile(di); Console.Read(); } static void FindFile(DirectoryInfo di) { FileInfo[] files = di.GetFiles(); for (int i = 0; i < files.Length; i++) { Console.WriteLine("文件:" + files[i].FullName); } }