WPF 获得文件夹路径可用FolderBrowserDialog类,
添加System.Windows.Forms引用,
并引用命名空间using System.Windows.Forms;
View Code
1 private void button1_Click(object sender, RoutedEventArgs e)
2 {
3 FolderBrowserDialog fbd = new FolderBrowserDialog();
4 fbd.Description = "pls select a folder";
5 if(fbd.ShowDialog() == DialogResult.OK)
6 {
7 textBox1.Text = fbd.SelectedPath;
8 }
9 }
作者:Work Hard Work Smart
出处:http://www.cnblogs.com/linlf03/
欢迎任何形式的转载,未经作者同意,请保留此段声明!