Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted

you can either shout post code or RTFM[^]
 
Share this answer
 
Hi
Use SearchOption.AllDirectories as shown below to search the file from directory and subdirectory.

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900