File search using c sharp
I want to search a file in all logical drives in computer using c sharp
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.
VulpesPosted Mar 22, 2011, 5:34 AM
To search all logical drives you'll need to use DriveInfo.GetDrives (http://msdn.microsoft.com/en-us/library/system.io.driveinfo.getdrives.aspx ) to iterate through each drive and then apply the recursive search method to each one in turn.
Notice that, if there are a lot of files on a drive, this method is very slow - much slower than the search facilities built into Windows itself which cache info internally to speed up the search.