private string SelectPath() //弹出一个选择目录的对话框 { FolderBrowserDialog path = new FolderBrowserDialog(); path.ShowDialog(); return path.SelectedPath; } private string SelectFile() //弹出一个选择文件的对话框 { OpenFileDialog file = new OpenFileDialog(); file.ShowDialog(); return file.SafeFileName; }
C# WinForm 选择目录路径和文件路径,布布扣,bubuko.com
原文:http://www.cnblogs.com/craigtao/p/3784215.html