搜索整个硬盘 [英] searching entier hard disk

查看:83
本文介绍了搜索整个硬盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想知道如何在计算机硬盘中搜索所有文件或特定文件...实际上我确实使用

使用system.io命名空间和directoryinfo.getfiles()

但是概率仅从其第一个子目录返回其文件,但我想搜索整个机器本身...

请为此提供邮政编码....预先感谢

hi ,


i wanna to know how to search all or specfic files in our computer hard disk...actually i did using

using system.io namespace and directoryinfo.getfiles()

but the probs s its returns files only from its very first sub dir but i wan to search whole machine itself...

pls post code for it....thanks in advance

推荐答案

,您可以喊邮政编码RTFM [


如下所示,使用 SearchOption.AllDirectories 从目录和子目录中搜索文件.

Hi
Use SearchOption.AllDirectories as shown below to search the file from directory and subdirectory.

string[] filePaths = Directory.GetFile(@"c:\MyDir\,*.*,SearchOption.AllDirectories);


这篇关于搜索整个硬盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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