From download location i need to send the todays pdf file new folder how can i do it? it is possible to do it
Hi Ashok
how can i do it
downloadFolder (String) = "C:\path\to\download\location"
newFolder (String) = "C:\path\to\new\folder"
today (DateTime) = Now.Date
filesMoved = Directory.GetFiles(downloadFolder, "*.pdf").Where(Function(f) New FileInfo(f).LastWriteTime.Date = today).ToList().ForEach(Sub(f) File.Move(f, Path.Combine(newFolder, Path.GetFileName(f))))
Use the below syntax to get the latest file:
todayFiles = System.IO.Directory.GetFiles("yourFolder","*.pdf").Where(Function(s) System.IO.File.GetCreationTime(s).Date=DateTime.Today).ToArray()
After that use Move file to move it to the particular folder.
Hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

