1 IEnumerable<string> files = Directory.EnumerateFiles(@"e:\image","*.*",SearchOption.AllDirectories); 2 IEnumerator<string> filesEnum = files.GetEnumerator(); 3 while (filesEnum.MoveNext()) 4 { 5 Console.WriteLine(filesEnum.Current); 6 }
1 IEnumerable<string> files = Directory.EnumerateFiles(@"e:\image","*.*",SearchOption.AllDirectories); 2 IEnumerator<string> filesEnum = files.GetEnumerator(); 3 while (filesEnum.MoveNext()) 4 { 5 Console.WriteLine(filesEnum.Current); 6 }