FolderBrowserDialog类实现选择打开文件

private void button1_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dilog = new FolderBrowserDialog();
            dilog.Description = "请选择文件夹";
            if(dilog.ShowDialog() == DialogResult.OK || dilog.ShowDialog() == DialogResult.Yes)
            {
                path=dilog.SelectedPath;
            }
        }

 

 

posted @ 2023-04-06 19:15  陆陆无为而治者  阅读(43)  评论(0编辑  收藏  举报