Get the last file every 24 hours

hello everyone

I had a question, please

I want to select just the last item every time because this list changes every 24h

Can someone help ![:pray:

i wanna choose the last file every time and then click choose
image

Hi Imene,

Please try to use below expression which help to get latest file

str_filepath = Directory.GetFiles(yourFolderPath,“*.fileExtension”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0)

Thanks.

1 Like

I am using a desktop application so this expression cannot work :frowning:

The idea is that you use the expression to retrieve the name of the latest file and then type it into the text field.

Another solution would be to activate the file list area and then just press End to select the last item.

image

1 Like

It worked thank you very much <3

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