Search file with help of c#
I want to search "any type" of "file" or "folder" in any directory of my system with the help of c#.
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
Sreejesh SPRank #1,975 · 740 reputationPosted Apr 24, 2013, 2:23 AM EDT
DirectoryInfo di = new DirectoryInfo(Server.MapPath("uploads"));
FileInfo[] rgFiles = di.GetFiles("*.jpg");
The above code is use access jpeg files.so which type of files you want,that type files extention replace the .jpg and use the above code
Thanks
Sreejsh