遍历文件夹所有文件(示例)
2007-12-28 22:51
507 查看
//要引用
using System.Collections.Specialized;
public StringCollection GetAllFiles(string rootdir)
void GetAllFiles(string parentDir, StringCollection result)
private void button1_Click(object sender, EventArgs e)
{
string indexPath = @"c:\temp";
StringCollection sc = GetAllFiles(indexPath);
foreach (string s in sc)
{
this.listBox1.Items.Add(s);
}
}
using System.Collections.Specialized;
public StringCollection GetAllFiles(string rootdir)
void GetAllFiles(string parentDir, StringCollection result)
private void button1_Click(object sender, EventArgs e)
{
string indexPath = @"c:\temp";
StringCollection sc = GetAllFiles(indexPath);
foreach (string s in sc)
{
this.listBox1.Items.Add(s);
}
}
相关文章推荐
- php遍历文件夹下的所有文件和子文件夹示例
- 遍历文件夹所有文件(示例)
- 编写的一个遍历文件夹下所有文件的类,含有一个应用示例
- 遍历某文件夹下所有文件,并输出保存在txt
- C#遍历指定文件夹中的所有文件
- Java遍历文件夹下所有文件并替换指定字符串
- 遍历文件夹下得所有文件并打印
- php遍历目录输出目录及其下的所有文件示例
- python 遍历一个文件夹下所有文件名称
- php遍历一个文件夹下的所有文件和子文件
- C# 使用foreach语句遍历指定文件夹中的所有文件或文件夹
- java遍历文件夹里面的所有文件
- 遍历读取指定文件夹下指定类型的所有文件
- VS2010 实现文件夹浏览、遍历所有文件
- Node.js使用递归实现遍历文件夹中所有文件
- 遍历文件夹下所有文件
- 黑马程序员-JAVA学习之文件夹的复制和遍历所有文件
- Delphi下遍历文件夹下所有文件的递归算法
- 遍历指定文件下所有的文件夹和文件的路径,文件名,修改日期,类型
- 遍历文件夹下的所有文件