I had been browsing the forum and haven’t met any suitable answer
So basically I need to download a file (the name will be generated randomly by system).
I need to do several activities after the download finished so I use file change trigger inside monitor events to let the robot know that a file has been created. But I am confused about what to pass as the filename to trigger the event because it will be generated randomly.
My questions are:
does my process considered as a good method or are there other simpler methods?
how to get the file name after it finished downloaded and passed it to the FileName.
May i know how many files and from the file is downloaded, will you be giving a name for it or will be downloaded as it is with its own name
Cheers @rookies
The below line give me the latest .xlsx file from a folder,
Directory.GetFiles(path).[Select](Function(x) New FileInfo(x)).Where(Function(f) f.Extension.Equals(".xlsx")).OrderByDescending(Function(x) x.LastWriteTime).Take(1).ToArray()(0).ToString()
Here path is my string variable to hold the directory path value
Thank you. It works. But I couldn’t use this on file change trigger because the process executed right away after i click download button. so it would not get the latest downloaded file as it is still on progress of downloading (it would get the other excel file on that folder instead)
What is the best way to make sure that this activity starts after the download finished?