winfrom 选择文件夹 电脑版发表于:2022/6/16 0:20 代码如下: ``` private void button3_Click(object sender, EventArgs e) { System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog(); dialog.Description = "请选择Txt所在文件夹"; if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string path = dialog.SelectedPath; textBox1.Text = path; } } ```