文件夹浏览器对话框

发布于 2024-09-02 17:00:18 字数 266 浏览 2 评论 0原文

我在应用程序中使用文件夹浏览器对话框来选择文件夹。现在我想要这样的事情,在文件夹中应该只有 html 文件,没有其他文件可供选择。就像如果我们有打开文件对话框并且只想显示 html 文件,那么我们使用 openfiledialog 的过滤器属性。那么我如何在文件夹浏览器对话框中执行此操作以保留或仅选择文件夹中的 html 文件?

那就是如何在文件夹浏览器对话框中过滤文件?

编辑 仅选择包含 .HTML 的文件夹

I am using Folder Browser Dialog in my application to select a folder. Now I want such a thing that in the folder there should be only html files nothing else to be selected. Like if we have open file dialog and only we want to display html file then we use filter property of openfiledialog.So how can I do that in folder browser dialog to remain or select only html files in the folder ?

That is how can I filter files in the folder browser dialog ?

EDIT select only folders containing .HTML.

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

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

发布评论

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

评论(3

番薯 2024-09-09 17:00:18

您要求并在编辑中强调使用文件夹浏览器来选择文件。这是一个矛盾。只需使用带有 *.HTML 过滤器的 FileOpen 对话框即可。

也许您的意思是:仅选择包含 .HTML 的文件夹,但没有对此的内置支持。

编辑

您必须考虑这对于嵌套文件夹意味着什么。您需要至少向前看一级的内容,但任何子目录都可能包含 HTML 文件(向下几级)。

You are asking, and you emphasize in your Edit, to use a FolderBrowser to select files. That is a contradiction. Just use a FileOpen dialog with a *.HTML filter.

Maybe you meant: select only folders containing .HTML, but there is no built in support for that.

Edit

You'll have to think about what this means for nested folders. You would need something that looks ahead at least one level, but any subdir could potentially have HTML files (a few levels down).

苏别ゝ 2024-09-09 17:00:18

使用它作为您的过滤器:

HTML files (*.htm; *.html)|*.htm;*.html|All files (*.*)|*.*

Use this as your filter:

HTML files (*.htm; *.html)|*.htm;*.html|All files (*.*)|*.*
夏末的微笑 2024-09-09 17:00:18

选择文件时使用文件夹浏览器对话框有什么特殊原因吗?打开的文件对话框是可过滤的,应该是您用于文件选择的对话框。

要得到真正的答案:据我所知,不可能过滤文件夹浏览器对话框。

Is there any particular reason you would use a folder browser dialog when you're selecting a file? An open file dialog is filterable and should be what you're using for file selection.

To get to the real answer: afaik, it's not possible to filter the folder browser dialog.

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