Reputation: 385
I have a network directory with thousands of files in several different subdirectories. I've been using Windows Explorer search to find files but it takes too long when I need to perform several consecutive searches. I'm interested in creating a C# form that will make this easier to do. Note that this file structure does not change often (if ever) so setting up some DB to hold file names / locations wouldn't be a bad thing, so long as I don't have to enter them manually.
Bonus question: the majority of the documents are PDFs... how can I have my search include text in the file itself?
Upvotes: 0
Views: 280
Reputation: 2738
Since you only want to search for files, the DB you will need can be just a big array / list / hashtable which are all available in C#. (Hashtable would be pretty good for what you want which is quick lookup, if you use the filename as the index).
To Insert all the files of a folder and all subfolders recursively into your DB you can use this answer.
And finally if you want to search inside the pdf you will probably need to do some work with indexing to make it fast. Here is how to read .pdf in C#
Upvotes: 1