I have a list file in a folder like the below image, i usually loop the files in a folder like this
Directory.GetFiles(folderLocation,“.”) , then set it to a variable with type array of object . But I want to have the oldest file to loop first i, scenario is work with oldest file to newest file. I seen many examples of getfiles.orderbyascend etc, none are working, how can I achieve this?
i keep getting datatype error, attempting to use this code, my variable is a datatype System.object , always used this for looping files but first time using like this
Directory.GetFiles(sourceFolder,“.”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Last