【发布时间】:2012-01-30 23:26:32
【问题描述】:
我想显示从文件夹中循环播放的图像。
<div class="blah">
<% System.IO.FileInfo[] files = new System.IO.DirectoryInfo(Server.MapPath("/MyPath/"))
.GetFiles();
var exefiles = from System.IO.FileInfo f in files
where f.Extension == ".jpg" ||f.Extension == ".jpeg"
|| f.Extension == "JPG"
select f;
foreach (System.IO.FileInfo f in exefiles) { %>
<img src="blahblah.jpg" />
<% } %>
</div>
问题:div 显示文件夹中存储的所有图像。
但我只想在我的 div 中显示 1 张图片。
非常感谢。
【问题讨论】:
-
如果文件夹中有多个jpg,如何确定显示哪一个?
-
您想在单独的 div 中显示每张图片吗?
标签: asp.net css asp.net-mvc