Searching for a specific file in windows
please help me, how to search in windows drive for specific files, get their list, check them one by one
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Deepak Bhatia142 reputationPosted Aug 2, 2010, 2:26 AM EDT
Hi,
Use this code.
string path = "c:\\";
//Type the name of directory or drive in which you want to search
string[] files = Directory.GetFiles(path, "*.gif", SearchOption.AllDirectories);
//*.gif write the search pattern to be searched