我正在使用 Ookii Vista 文件夹对话框以方便使用,并且我正在执行此代码,该代码是从按钮调用的:
using System;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using Ookii.Dialogs;
private string LoadDirectories()
{
VistaFolderBrowserDialog fbd = new VistaFolderBrowserDialog();
if (fbd.ShowDialog() == DialogResult.OK && fbd.SelectedPath.Contains("U000"))
{
return fbd.SelectedPath;
}
else
{
MessageBox.Show("Folder must be root assembly, which has U000 in name");
}
return string.Empty;
}
目前,如果用户没有选择U000
名称中的文件夹,对话框将关闭,但我希望它保持打开状态,直到用户取消或设置正确的文件夹路径。我在任何地方都找不到这个。