在可移动设备使用的FolderBrowserDialog /移动存储 [英] Using FolderBrowserDialog on a Removable Device / Removable storage

查看:175
本文介绍了在可移动设备使用的FolderBrowserDialog /移动存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个简单的复制工具来复制文件从数码相机。我写的文件拷贝code,我已经把一切都迷上了很好的。

I'm working on a simple copy tool to copy files off digital cameras. I've written the file copy code, I've got everything hooked up nicely.

这个问题我似乎是与的FolderBrowserDialog。在Vista中(我没有检查XP还),我可以浏览到相机上的目录。然而,的FolderBrowserDialog不会让我在相机上选择一个目录。确定按钮是灰色的。

The issue I have seems to be with the FolderBrowserDialog. In Vista (I haven't checked XP yet), I can browse to the directories on the camera. However the FolderBrowserDialog will not let me select a directory on the camera. The OK button is greyed out.

看着它看起来像这样相机上的文件的路径:

Looking at the path for the files on the camera it looks like this:

Computer\[Camera Name]\Removable storage\AnotherDirectory\

由于这不是一个有效的路径(C的这一翻译:\等等),我猜的FolderBrowserDialog不喜欢这种

As this is not a valid path (intead of C:\whatever), I'm guessing the FolderBrowserDialog doesn't like this.

它工作正常,从一个有效的路径名,但不能关闭相机...

It works fine from a valid path name, but not off the camera...

没有人有任何建议,以解决这个问题?

Does anyone have any suggestions to get around this?

更新

要确认oefe的研究路径实际上是显示为:

To confirm oefe's question the path is actually displayed as:

Computer\[Camera Name]\Removable storage\AnotherDirectory\

使用的SHBrowseForFolder的ChulioMartinez的建议下做的工作,我会标记为正确答案。感谢您的帮助Chulio。

ChulioMartinez's suggestion of using SHBrowseForFolder does work, and I will mark as the correct answer. Thanks for your help Chulio.

推荐答案

我的猜测是,该位置没有一个文件系统重新presentation(路径)如 C:\我的相机

My guess would be that the location doesn't have a file system representation (path) such as c:...\my camera.

您应该能够得到PIDL的文件夹,(它应该是一个标志的功能),并使用COM壳接口来实现复制。

You should be able to get the PIDL of the folder, (it should be one the the flags for the function), and implement the copy using the COM shell interfaces.

的SHBrowseForFolder

使用PIDL枚举一个文件夹

这篇关于在可移动设备使用的FolderBrowserDialog /移动存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆