I see .NET has the option: SearchOption.TopDirectoryOnly
which helps me to limit the file list retrieval for just the selected directory, not subdirectories. I would like to know whether .NET CF has any options to do so?
views:
87answers:
1
A:
The .Net Compact Framework has no built-in methods that recurse subdirectories.
If you just want to get the files that are directly in a directory (and not the subdirectories), you can simply call Directory.GetFiles
.
SLaks
2010-05-25 17:11:01
Sorry, it's DirectoryInfo, new DirectoryInfo(...).GetFiles(path)
2010-05-25 17:24:17
I think you have not gotten my idea, I just want to get just files in the selected directories, not all files in subdirectories. Is there any way?
2010-05-25 17:25:42
`TopDirectoryOnly` is the default. You can just call `GetFiles`.
SLaks
2010-05-25 17:30:57