C# 遍历文件夹
来源:互联网 发布:算法导论有第四版吗? 编辑:程序博客网 时间:2024/06/17 06:14
//浏览文件夹
private void button1_Click(object sender, EventArgs e)
{
if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
if (this.folderBrowserDialog1.SelectedPath.Trim() != "")
this.text_FolderName.Text = this.folderBrowserDialog1.SelectedPath.Trim();
}
}
//显示指定文件夹下的子文件夹
private void button2_Click(object sender, EventArgs e)
{
if (this.text_FolderName.Text.Trim() == "")
return;
this.listBox1.Items.Clear();
//获取指定文件夹下的所有子文件夹
string[] MyFolders = System.IO.Directory.GetDirectories(this.text_FolderName.Text);
this.listBox1.Items.AddRange(MyFolders);
}
private void button3_Click(object sender, EventArgs e)
{
//同时显示指定文件夹下的子文件夹和文件
if (this.text_FolderName.Text.Trim() == "")
return;
this.listBox1.Items.Clear();
//获取指定文件夹下的所有文件和子文件夹
string[] MyFoldersFiles = System.IO.Directory.GetFileSystemEntries(this.text_FolderName.Text);
this.listBox1.Items.AddRange(MyFoldersFiles);
}
0 0
- c#遍历文件夹
- c#遍历文件夹
- C# 遍历文件夹
- C#递归遍历文件夹
- C# 遍历文件夹
- C#遍历文件夹
- C# 遍历文件夹 创建树
- C#遍历文件夹及文件
- C#遍历文件夹中的文件
- C#遍历文件夹及其子目录
- C#遍历文件夹和文件
- C# 遍历FTP文件夹/下载
- C#遍历文件夹及其子目录
- c#遍历文件夹和文件
- C#遍历文件夹及文件
- C#遍历所有文件夹处理
- C#遍历文件夹及文件
- C# 遍历文件夹加载到DataSet里面
- NSPredicate类的使用
- linux设备驱动开发-设备阻塞访问的简单实现
- IOS总结_获取当前的日期,时间,星期几
- 集http上传下载、sqlite的orm框架等实用功能的快速开发框架Afinal
- Android中自定义样式与View的构造函数中的第三个参数defStyle的意义
- C# 遍历文件夹
- 怎么得到优酷网mp4格式视频文件url
- 启动错误
- strtok和strtok_r
- OCP 1Z0 052 167
- 关于字符编码的细节,你知道吗?
- 尊重原创11
- Android多媒体开发【6】-- 播放器的基本模型
- cocos2d-x 中的一些数学函数