简体   繁体   English

允许用户在 C# WinForms 应用程序中选择文件/文件夹

[英]Allow user to choose file/folder in C# WinForms app

How can I user to choose a file or a folder from within my forms app?用户如何从我的表单应用程序中选择文件或文件夹?
Is there not a built in component for it?没有内置组件吗?

There are a few depending on exactly what you need to do:有几个取决于您需要做什么:

您可以通过WindowsAPICodePack包使用CommonOpenFileDialog来选择文件和dialog.IsFolderPicker = true以启用文件夹选择

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM