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
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Deepak BhatiaPosted Aug 2, 2010, 6:26 AM
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