该文件夹浏览器对话框是要走的路.
如果要设置初始文件夹路径,可以将其添加到表单加载事件:
// Sets "My Documents" as the initial folder path string myDocsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); FolderBrowserDialog1.SelectedPath = myDocsPath;
检查FolderBrowserDialog类.
// ... if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { textBox1.Text = folderBrowserDialog1.SelectedPath; }