I have a FileInfo object that receives all images from a directory:-
string Path = HttpContext.Server.MapPath("~/Content/TempImages/");
DirectoryInfo directory = new DirectoryInfo(Path);
FileInfo[] files = directory.GetFiles();
This works fine and gets all the images from the directory. However, I only want to get specific images from the directory which I have in a list (ImagesToShow):-
string Path = HttpContext.Server.MapPath("~/Content/TempDocs/");
foreach (var image in ImagesToShow)
{
//How do I add all image.imageName to the FileInfo[] object?
}