foreach - C# - Find specific folders -
i'd directories specific file names:
foreach (string subdirtrans in directory.getdirectories(path))
for instance getdirectories path/dir1, path/dir2 etc.
is possible?
you can use code:
var names = new string[] { "dir1", "dir2" }; var directories = system.io.directory.getdirectories("path", "*", system.io.searchoption.alldirectories) .where(d => names.contains(system.io.path.getfilename(d))) .tolist();
Comments
Post a Comment