.NET中使用CommonOpenFileDialog【打开文件夹】

install-package WindowsAPICodePack

var folderDialog = new CommonOpenFileDialog()
{
    Title = "xxx",
    IsFolderPicker = true,
};
if (folderDialog.ShowDialog() == CommonFileDialogResult.Ok)
{
    string selectedFolder = folderDialog.FileName;
    
}
posted @ 2024-01-16 21:44  JohnYang819  阅读(139)  评论(0编辑  收藏  举报