使用savefileDialog选择文件夹路径 [英] Select Folder Path with savefileDialog

查看:98
本文介绍了使用savefileDialog选择文件夹路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用对话框窗口获取不带名称文件的文件夹路径?

Is there a way to using a dialog window to get the folder path without name file?

推荐答案

检查文件夹浏览器对话框

// Bring up a dialog to chose a folder path in which to open or save a file.
private void folderMenuItem_Click(object sender, System.EventArgs e)
{
    var folderBrowserDialog1 = new FolderBrowserDialog();

    // Show the FolderBrowserDialog.
    DialogResult result = folderBrowserDialog1.ShowDialog();
    if( result == DialogResult.OK )
    {
        string folderName = folderBrowserDialog1.SelectedPath;
        ... //Do your work here!
    }
}

这篇关于使用savefileDialog选择文件夹路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆