how to ignore image in list in c#

Jan 28 2016 11:53 PM
how to ignore image in list in c#
 
 
public void bindrepe()
{
string[] filesindirectory = Directory.GetFiles(Server.MapPath("~/images"));
var ss = filesindirectory;
List<String> images = new List<string>(filesindirectory.Count());
images.Remove(Server.MapPath("~/images/blank.gif"));//here i removed image
images.Remove(Server.MapPath("~/images/happy vans logo.png"));//here i removed image 
foreach (string item in filesindirectory)
{
images.Add(String.Format("~/images/{0}", System.IO.Path.GetFileName(item)));
}
Image1.ImageUrl = images[2];
RepeaterImages.DataSource = images;
RepeaterImages.DataBind();
}
 
 
actually before looping i want to ignore that two images beacue in for loop iam usuing Filesindirectroy so in filedirectroy i want to remove images 

Answers (3)