使用OpenFileDialog选择文件和文件夹 [英] Select both files and folders using OpenFileDialog
问题描述
我已经进行了大量研究以找到适合该问题的答案,但我失败了.
I have researched a lot to find a suitable answer to this problem, but I am failing .
我可以在这里和其他论坛上看到多个问题,但是没有明确的答案可以提供明确的解决方案.
I can see multiple questions asked here and on other forums also , but no clear answer that brings a clear solution .
我希望OpenFileDialog可以为我选择一个文件,也可以选择文件夹.例如.一种.多个文件或多个文件夹(-最优先) b.文件和文件夹的组合(较少的优先级)
I want OpenFileDialog to select file/files for me as well as allow me to select folders also. eg. a. either Multiple files OR multiple folders (- most Prior) b. combination of Files and Folders (-less Prior)
我在这里找到了类似的问题(因此请不要将其标记为重复的内容)
I figured our similar question here ( so please don't mark it as duplicate )
问题1 [答案链接已断开]
Question 1 [Answer links are broken]
问题2 [问题是并没有完全问我的要求是什么.]
Question 2 [Question isn't completely asking what my requirements are.]
请为我提供一些解决方案.我是新手还是学习者.
Please guide me through some solution . I am a novice and a learner.
任何帮助或指针都将非常有帮助.
Any help or pointers would be very helpful .
谢谢.
推荐答案
您不能使用OpenFileDialog
选择文件夹,也不能使用FolderBrowserDialog
选择文件.但是.net有一个开源控件,它允许您选择文件和文件夹,您可以在这里检查它: OpenFileOrFolderDialog
You can't select folder with OpenFileDialog
as well as you can't select files with FolderBrowserDialog
. But there is an open source control for .net which allows you to select both files and folders you can check it here : OpenFileOrFolderDialog
这篇关于使用OpenFileDialog选择文件和文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!