010——C#选择文件路径
作者:互联网
(一)具体教程查看:011——C#创建ECXEL文件(附教程)
(二)代码:foldPath 就是获取到的文件路径
private void button1_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.Description = "请选择文件路径"; string foldPath = ""; if (dialog.ShowDialog() == DialogResult.OK) { foldPath = dialog.SelectedPath + @"\"; } textBox1.Text = foldPath;
}
标签:文件,FolderBrowserDialog,C#,路径,010,dialog,foldPath 来源: https://www.cnblogs.com/luxiaoguogege/p/11631028.html