How to read files from folder

studio

#1

read 3 files based creation of date in descending order hello.xaml (17.3 KB)


How i do for each files in a folder
#2

Directory.GetFiles(folder_inside_path,".",SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(3)


#4

addd .Take(3) at the end


#5

getLatestExcel.xaml (12.2 KB)

Can anyone help me resolving this error. There is issue in type casting. I am trying to get single file name with path which is latest/very new/fresh from downloads folder.


#6

@viraj_thakrar Your “excelfile” variable type is String. Change it to IEnumerable.


#7

Yes. Its working perfect now. I am able to get latest single file from folder. Thank you @ovi. Thank you guys.


#8

how to get that file from ienumerable type?


#9

Hi. Go to the variable type and browse for other types . There you can find the ienumerable option.