Just wondering if anybody had any hints for retrieving lists of files and folders within directories.
I know about DirectoryInfo and GetFileSystemInfos() and FileSystemInfo and so on, but the performance with them - particularly over a network - seems pretty dire, apparently due to them making too many network requests for each file returned, rather than storing the information that the underlying win32 calls they make has already received. It's something that's supposed to be much better with .NET4, but I guess we have to stay with .NET 2 for now? (and I'm not too sure how it works if you have a .NET2 compiled program but .NET4 is actually installed; can it use the latter or will it insist on running it with .NET2 anyway).
I did find this (and a few like it), that sounded hopeful, but it only returns files within a folder, whereas I need lists of files *and* folders together.
It's possible part of the problem is that I'm trying to be too smart when browsing a folder, as my plugin also goes looking into the subdirectories of the list returned (eg to determine if they might contain DVD rips). This means it's actually doing more than just a single GetFileSystemInfos() call, but I kind of need to know this information before building a UiList of possible videos to play. That way DVD folders and folders with just a single video in them can be presented at the same level as other video files found within a given directory.
Edit: This was the other one I found: http://www.codeproject.com/KB/files/...px?msg=3177659
Last edited by imilne; 2011-08-20 at 08:05 PM.