views:

186

answers:

2

Using a FolderBrowserDialog in a USB Drive takes several minutes to offer subfolders (independently of how many subfolders are there). Whereas Windows Explorer does show them in a relatively quick manner.

Code I'm using is:

if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) {
  //grab value
}

I navigate to the USB drive, and click on a folder in the root to have to wait lots of time.

This is .NET 2.0 SP1 (32 bits executable) on Windows Server 2003 x64

Is there any known cause for this? Why is it taking so much longer than Windows Explorer?

A cursory Google search seems to indicate I'm alone in this. I've found references to it crashing on 64 bit systems, but I don't actually get a crash, if I wait the several minutes it ends up working.

A: 

HAve you tried to debug windows explorer wich system call is he reffering when opening subfolders ? And do the same for your application ? Either there is a difference in system call or is doing something more. Or last case it fails many times and only some times succedes.

CrazyChris
A: 

What version is the USB port you're attached to? 1.0/1.1 will take a lot longer to respond than 2.0. Also, if you have a version of Windows that does behind-the scenes indexing of attached devices, it may have been indexed it by the time you click on it in Explorer; your function is doing it 'live and in-person', so to speak.

DaveE