datalist 行 绑定下载文件
ASP.net2008 在Datalist 行已经绑定了数据, 有id,名称, 文件名称。(也可以再加个图标) 我再用程序遍历磁盘,当一个值和文件名称相同时 这行的图标显示,或者加其他字段,否则不显示。遍历程序我有了,给出绑定代码或方式就可以了。谢谢
string[] files = Directory.GetFiles(Server.MapPath("../Download/"+softname+""));
foreach (string myfile in files )
{
if (File.Exists(myfile) && Path.GetFileName(myfile) == proname)
{
string strurl = "../Download/" + softname + "/" +Path .GetFileName (myfile ) + "";
Response.Redirect(strurl);
}
}