Hi,
Using: Directory.GetFiles(“YourFolderPath ”,“*.PDF”).OrderByDescending(function(x) new FileInfo(x).LastWriteTime).FirstOrDefault
To get the latest pdf from downloads but i want to save that name of the pdf in a variable how do i do that?
Hi,
Using: Directory.GetFiles(“YourFolderPath ”,“*.PDF”).OrderByDescending(function(x) new FileInfo(x).LastWriteTime).FirstOrDefault
To get the latest pdf from downloads but i want to save that name of the pdf in a variable how do i do that?
Use like this
Path.GetFileName( Directory.GetFiles(YourFolderPath","*.PDF").OrderByDescending(function(x) new FileInfo(x).LastWriteTime).FirstOrDefault)
Cheers
Hi @Anil_G
An error is occuring saying get file name is not a member of string.
This works. thank you @Anil_G .
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.