Search code examples
.netsearchntfs

Searching NTFS directory .NET


I would like to write a web page where users can search a directory on NTFS for certain criteria and display the results.

Does the directory have to be indexed?

Is there a .NET accessible windows search API that I can use to query the directory?


Solution

  • All you get is System.IO.DirectoryInfo, and it doesn't even have built in searching.

    Most people end up writing a recursive method that calls getDirectories and getFiles on each DirectoryInfo.