Open Latest Downloaded files

I have gone through similar post in forum and slight modifications as been made from my end.
Using this syntax i am getting File name twice, Can any one help why it is fetching 2 times.

String.Join(“parameter”,Directory.GetFiles(FolderPath,”*.xlsx”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1))

Thanks in Advance

@km81 Can you try with the below expression.

Directory.GetFiles(FolderPath,”*.xlsx”).OrderByDescending(Function(d) New FileInfo(d).CreationTime

If you just want to get it in list form you can the above.

Thx for quick reply

The above syntax shows compiler error


Please refer to the below post.

String.Join(“parameter”,Directory.GetFiles(FolderPath,”*”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(n))

I have tried that syntax also but getting two times again

Pls help

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.