private void button1_Click(object sender, EventArgs e) { folderBrowserDialog1.ShowNewFolderButton = true;//是否显示新建的文件夹选项 DialogResult dr = folderBrowserDialog1.ShowDialog();//显示选择文件夹对话框 if (dr == DialogResult.OK) { MessageBox.Show(folderBrowserDialog1.SelectedPath, "选择的路径");//显示选择的路径 } }
时间: 2024-11-15 02:48:34