您的位置:首页 > 运维架构

遍历文件夹里面的文件,并绑定到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();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: