摘要:
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);其他形如 我的电脑 , 我的音乐 , 我的图片 等特殊路径获取,详见:http://msdn.microsoft.com/zh-cn/library/vstudio/system.environment.specialfolder(v=vs.100).aspx 阅读全文
摘要:
private string[] GetFiles() { string[] files = null; OpenFileDialog dlg = new OpenFileDialog(); dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); dlg.Multiselect = true; //dlg.Filter = "txt files (*... 阅读全文
摘要:
WPF 获得文件夹路径可用FolderBrowserDialog类, 添加System.Windows.Forms引用, 并引用命名空间using System.Windows.Forms;privatevoid button1_Click(object sender, RoutedEventArgs e) { FolderBrowserDialog fbd =new FolderBrowserDialog(); fbd.ShowDialog(); textBox1.Text = fbd.SelectedPath; } 本文来自work hard work smar... 阅读全文