Page 1 of 1

How to get the path of the latest file from the folder

Posted: Thu May 30, 2019 2:35 pm
by premravi
Hi,

I am trying to get the location of the latest html file from a specific path/folder

Actually everytime after successful run one new html report will generate (NOTE : This HTML report is not Ranorex specific this is custom report)

Basically the requirement is:
I am trying to get the path of that newly generated html file and store it into a variable and I will use that variable to call that to make sure that YES
"File got generated successfully"

So, I am not getting how can I get the path of that file
like say for an instance

C:\Fusion\Results\ResultsSummary_2019.05.28-04.37.47\Results_DetailedReport_2019.05.28-04.37.47.html

Get this path and store it in a variable

Regards

Re: How to get the path of the latest file from the folder

Posted: Thu May 30, 2019 2:46 pm
by Stub
I would take a look at System.IO.FileInfo.