0

I am trying to make image gallery for my website . in my case i am showing thumbnail of all images and if we clicks on the image it shows image in modal window . there are 2 folders

  1. Thumbs (consist thumbnail)
  2. Full image (consist full image)

i have put the image with the same name ,as well i can do it by giving path of my images hard coded like this code

  <ul id="gallery">
      <li><a  href="http://ppplugins.com/demo/ppgallery/images/l_01.jpg" title="Title will be here"><img class="GalleryThumbnail" src="http://ppplugins.com/demo/ppgallery/images/s_01.jpg"></a></li>
    </ul>

But dont know how can we do it without giving value hard coded . please help me . like if i add more iages in that folders it must show the image on page . checkout here 1>http://182.50.154.23/elweb//CheckImagesFromFolder.aspx(trying to make it as 2nd link given below but not using source hard coded) 2>http://182.50.154.23/elweb//Gallery.aspx (required output)

4

2 回答 2

0
        var thumbs = Directory.GetFiles("your thumbs directory");
        var images = Directory.GetFiles("your images directory");
        foreach (var image in images)
        {
            var thumbname = thumbs.Where(x => x.Substring(2) == image.Substring(2));
        }

我不确定这是否是您想要的,但如果文件位于两个单独的文件夹中,它将采用它们的路径。

您还可以将拇指与图像进行比较,比较它们的名称。

于 2013-06-28T09:13:26.537 回答
0

使用数据库存储图像名称和路径。使用 reapeter 控件显示图像列表。

于 2013-06-28T09:33:24.547 回答