I am working on displaying an image that I want to loop through from a folder.
<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;
int count = 0;
foreach (System.IO.FileInfo f in exefiles) { %>
<img src="blahblah.jpg" />
<% if(++count >= 1) break; %>
<% } %>
</div>
Issue: The div currently displays all images stored in the folder.
However, my goal is to have only one image displayed in the div.
Thank you for your help!