如何检查并选择目录中的.pdf文件文件,如果目录中没有.pdf文件,则不必读取目录 [英] How to check and select the .pdf files files in the directory and if there are no .pdf files in the directory it wont has to read the directory

查看:126
本文介绍了如何检查并选择目录中的.pdf文件文件,如果目录中没有.pdf文件,则不必读取目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找代码,在哪里选择只有.pdf文件的目录而不是其他任何东西

I am looking for the code where to select the directory which has only .pdf files and not anything else

推荐答案

使用DirectoryInfo [ ^ ]和文件信息 [ ^ ]检查文件。

使用DirectoryInfo类搜索中的文件单个模式和多个模式上的目录 [ ^ ]将作为适合您的文章。
Use DirectoryInfo[^] and FileInfo[^] to check for files.
Using DirectoryInfo class to search for files in a directory on both single pattern and multiple patterns[^] will act as a suitable article for you.


这篇关于如何检查并选择目录中的.pdf文件文件,如果目录中没有.pdf文件,则不必读取目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆