用FolderBrowserDialog选择一个文件路径 ,方法如下:
-
private void button3_Click(object sender, EventArgs e)
-
{
-
System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
-
System.Windows.Forms.DialogResult result = folderBrowserDialog.ShowDialog();
-
if (result == System.Windows.Forms.DialogResult.OK)
-
{
-
this.textBox1.Text = folderBrowserDialog.SelectedPath;
-
}
-
}
转自博客:
http://blog.163.com/lm_regina/blog/static/17419653620115859094/
阅读(1863) | 评论(0) | 转发(0) |