image - Load pictures from folder using c# based on filename criterial? -
recently i'm working application, problem faced is:
how can load image folder data grid view based on file date created criteria, file tag.
i appreciate really!
the folder contains pictures is:
the controls want load pictures is:
at time date criteria show image based on date file created.
the button clicked show images is:
private void btn_show_click(object sender, eventargs e) { }
thanks help!
i bet solved question in case didn't here answer:
public partial class form1 : form { imagelist list = new imagelist(); public form1() { initializecomponent(); getimages(); } private void getimages() { string path = @"c:\imgfolder"; string[] filter = { ".bmp", ".jpg", ".jpeg", ".png" }; directoryinfo directoryinfo = new directoryinfo(path); fileinfo[] fileinfo = directoryinfo.getfiles(); arraylist arraylist = new arraylist(); foreach (fileinfo fi in fileinfo.where(f => f.creationtime >= yourfromdatevariable && f.creationtime <= yourtodatevariable)) foreach (string s in filter) if (s == fi.extension) arraylist.add(fi.fullname); //adding files image list: (int = 0; < arraylist.count; i++) { image img = image.fromfile(arraylist[i].tostring()); list.images.add(img); } } }
Comments
Post a Comment