You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
downkyi/DownKyi/Utils/DialogUtils.cs

27 lines
738 B

using System.Windows.Forms;
namespace DownKyi.Utils
{
public static class DialogUtils
{
/// <summary>
/// 弹出选择文件夹弹窗
/// </summary>
/// <returns></returns>
public static string SetDownloadDirectory()
{
// 选择文件夹
FolderBrowserDialog dialog = new FolderBrowserDialog
{
Description = DictionaryResource.GetString("SelectDirectory")
};
DialogResult showDialog = dialog.ShowDialog();
return showDialog == DialogResult.OK || showDialog == DialogResult.Yes
? string.IsNullOrEmpty(dialog.SelectedPath) ? "" : dialog.SelectedPath : "";
}
}
}