FolderBrowserDialog 需要很长时间才能列出位于 USB 驱动器中的文件夹的子文件夹

发布于 2024-07-25 13:07:57 字数 461 浏览 1 评论 0原文

在USB 驱动器中使用FolderBrowserDialog 需要几分钟的时间来提供子文件夹(与子文件夹的数量无关)。 而 Windows 资源管理器确实以相对较快的方式显示它们。

我使用的代码是:

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

我导航到 USB 驱动器,然后单击根目录中的文件夹,需要等待很多时间。

这是 Windows Server 2003 x64 上的 .NET 2.0 SP1(32 位可执行文件)

是否有任何已知原因? 为什么它比 Windows 资源管理器花费的时间长得多?

粗略的谷歌搜索似乎表明我是唯一一个这样做的人。 我发现它在 64 位系统上崩溃的引用,但实际上我并没有崩溃,如果我等待几分钟它最终会工作。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

睫毛溺水了 2024-08-01 13:07:57

您是否尝试过调试 Windows 资源管理器,他在打开子文件夹时是否引用了系统调用? 对您的应用程序执行同样的操作吗? 要么是系统调用有差异,要么是做了更多的事情。 或者最后一种情况,它失败了很多次,只有几次成功。

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.

新人笑 2024-08-01 13:07:57

您连接的 USB 端口是什么版本? 1.0/1.1 比 2.0 需要更长的时间来响应。 此外,如果您的 Windows 版本可以在幕后对连接的设备进行索引,那么当您在资源管理器中单击它时,它可能已经被索引了; 可以这么说,你的职责是“现场、面对面”地进行。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文