views:

87

answers:

1

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?

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
Sorry, it's DirectoryInfo, new DirectoryInfo(...).GetFiles(path)
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?
`TopDirectoryOnly` is the default. You can just call `GetFiles`.
SLaks