c# - 在 C# 中浏览一个目录

标签 c# .net directory

我如何向用户显示允许他/她选择目录的控件?

似乎没有任何 native .net 控件可以执行此操作?

最佳答案

string folderPath = "";
FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) {
    folderPath = folderBrowserDialog1.SelectedPath ;
}

关于c# - 在 C# 中浏览一个目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11767/

相关文章:

.net - 通过 SSLStream 发送数据时的数据包碎片

c++ - 如何布局C++代码: namespaces and similar file names in visual studio 2010

c# - Xamarin iOS SIGABRT 崩溃

c# - hunspell 拼写检查

c# - 返回数组而不创建变量

c# - 使用 .NET 删除目录中超过 3 个月的文件

regex - 如何使用 powershell 从我的文件名中删除多余的空格?

c# - 通过 XSLT 显示 C# 控件

c# - MediaElement.IsLoaded 谎言

c# - 数组的 GetUpperBound() 和 GetLowerBound() 函数