Created
May 25, 2017 22:01
-
-
Save a5ync/6085b54a1d38e9e090795c9194877fd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<string> ListAllFiles(string path) | |
{ | |
var directories = Directory.GetDirectories(path); | |
foreach (var directory in directories) | |
{ | |
foreach (string x in ListAllFiles(directory)) | |
{ | |
yield return x; | |
} | |
} | |
var files = Directory.GetFiles(path); | |
foreach (var file in files) | |
{ | |
yield return file; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment