how to remove particular image in list

Jan 30 2016 11:29 AM
cntitem = 0;
DirectoryInfo dirst = new DirectoryInfo(MapPath("~/images"));
FileInfo[] file = dirst.GetFiles();
ArrayList list = new ArrayList();
foreach (FileInfo file2 in file)
{
list.Add("/Images/"+file2);
cntitem++;
}
///below code is working but i dnt want this type ("~/images/blank.gif" i want this image only remove)
list.RemoveAt(2);//we can delete using index particular iamge
list.RemoveAt(3);//
Session["cnt"] = cntitem;

Answers (2)