So, I’m working on a project and I need to figure out if there are any .pdf files in a particular folder.
I’m not sure of the best way to check for them.
Any suggestions or methods you’ve used before to handle something like this would be super helpful!
This code checks if there are any .pdf files in the C:\Test folder:
Directory.GetFiles(“C:\Test”, “*.pdf”).Length > 0
• It searches for .pdf files in the folder.
• If the count of files is greater than 0, it returns true (files exist), otherwise false.