标签:自定义 alt c# 分享 dia select rms nbsp ring
引用:using System.Windows.Forms;
代码:
FolderBrowserDialog fbWnd = new FolderBrowserDialog();
fbWnd.Description = "选择最终目录"; //目录对话框的描述字符串
fbWnd.SelectedPath = "C:"; //自定义从哪个目录下面选择
fbWnd.ShowNewFolderButton = true; //是否显示目录对话框左下角的“新建文件夹”按钮, true:显示, false: 隐藏
string strbtn = fbWnd.ShowDialog().ToString(); //目录选择完之后是点击确认还是点击取消, 确认: OK, 取消: Cancel
if (strbtn.CompareTo("OK") == 0)
{
System.Windows.MessageBox.Show("点击确认: " + fbWnd.SelectedPath);
}
if (strbtn.CompareTo("Cancel") == 0)
{
System.Windows.MessageBox.Show("点击取消: " + fbWnd.SelectedPath);
}
如图:
标签:自定义 alt c# 分享 dia select rms nbsp ring
原文地址:http://www.cnblogs.com/hul201610101100/p/6938808.html