Hi folks, gud mrg
I have to get Today’s only Pdf files from particular folder
Thanks
Shaik Muktharvalli
Hi folks, gud mrg
I have to get Today’s only Pdf files from particular folder
Thanks
Shaik Muktharvalli
HI,
How about the following expression?
todayFiles = System.IO.Directory.GetFiles("yourFolder","*.pdf").Where(Function(s) System.IO.File.GetCreationTime(s).Date=DateTime.Today).ToArray()
note: todayFiles is string array type.
The above identifies today’s file by creation time from file system. If it doesn’t work for you, can you share how to identify today’s file.
Regards,
You can use the linq expression to get the files which are created today, create a variable called TodayFiles it is a Array of String datatype,
- Assign -> TodayFiles = System.IO.Directory.GetFiles("Folder Path here", "*.pdf").Where(Function(File) File.GetLastWriteTime().Date = DateTime.Today).ToArray()
Hope it helps!!
Can you try the following expression?
System.IO.Directory.GetFiles("yourFolder","*.pdf").Where(Function(s) System.IO.File.GetCreationTime(s).Date=DateTime.Today).Select(Function(s) System.IO.Path.GetFileName(s)).ToArray()
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.