遍历文件夹里面的文件,并绑定到dropdownlist
2010-02-02 10:32
239 查看
string rep_path = Server.MapPath("reports");
string[] files = Directory.GetFiles(rep_path);
string[] report_files = new string[files.Length];
for (int i = 0; i < files.Length; i++)
{
report_files[i] = files[i].Replace(rep_path + "//", "");
}
DropDownList1.DataSource = report_files;
DropDownList1.DataBind();
string[] files = Directory.GetFiles(rep_path);
string[] report_files = new string[files.Length];
for (int i = 0; i < files.Length; i++)
{
report_files[i] = files[i].Replace(rep_path + "//", "");
}
DropDownList1.DataSource = report_files;
DropDownList1.DataBind();
相关文章推荐
- C#如何遍历一个文件夹下面所有的文件、包括子文件夹里面的文件?
- 递归遍历文件夹里面的文件
- 递归遍历文件夹里面的文件
- 递归遍历文件夹里面的文件
- 选择文件夹并遍历里面的文件
- asp.net 读取xml文件里面的内容,绑定到dropdownlist中
- c++遍历文件夹里面的所有文件(1)
- 递归遍历文件夹里面的文件
- 递归遍历文件夹里面的文件
- 递归遍历文件夹里面的文件
- 读取Assets所存在的所有文件(遍历每一个文件夹),并存入sdcard里面
- 递归遍历文件夹里面的文件
- 递归遍历文件夹里面的文件
- 递归遍历文件夹里面的文件
- C# 遍历读取某个目录文件夹下的不同类型子文件和其子文件夹(里面可能又有许多文件)
- asp.net 枚举文件里面的数字绑定到DropDownList里面去
- 遍历文件夹绑定文件到TreeView控件
- 递归遍历文件夹里面的文件
- 递归遍历文件夹里面的文件
- 递归遍历文件夹里面的文件