获取目录路径以读取其中的文件 [英] get Directory path to read file inside it

查看:75
本文介绍了获取目录路径以读取其中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i浏览文件夹并选择包含文件数的文件夹,这样当我选择该文件夹时,我需要所选文件夹的路径

hi
i browse the folde and select the folder whic contain number of file in it so when i select that folder i need the path of that selected folder

推荐答案

试试这个..





使用 SelectedPath 获取文件夹路径的属性



Try this..


use SelectedPath property to get the folder path

private void button1_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();
            if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                MessageBox.Show(fbd.SelectedPath);
            }
        }


这篇关于获取目录路径以读取其中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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