VS中让用户选择路径

            //选择文件
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.ShowDialog();
            MessageBox.Show(ofd.FileName);

            //选择文件夹
            FolderBrowserDialog fbd = new FolderBrowserDialog();
            fbd.ShowDialog();
            MessageBox.Show(fbd.SelectedPath);
相关文章
相关标签/搜索