您的位置:首页 > 其它

遍历文件夹所有文件(示例)

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);

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: