Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a folder with lot of files like doc,excel,ppts etc.. once the user selects a catagory from the combo i have assigned key words related to the particular selection. Now w.r.t to the key words my wpf application has to search the entire folder and content of the files which are matching to key words and display the matching files in a gridview. Speed and performance also has to be maintained

Kinldy request someone to help me.
Posted

Check my article here : hOOt - full text search engine[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 23-Nov-11 1:43am    
Remember that one, a 5.
--SA
Mehdi Gholam 23-Nov-11 1:47am    
Thanks man.
What you are trying to do is most definitely not a trivial task. You should take a look at these articles to give yourself a head start

Using IFilter in C#[^]

C# search engine: refactored to search Word, PDF and more[^]

Good luck
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 23-Nov-11 1:43am    
Good links, a 5.
--SA
Wayne Gaylard 23-Nov-11 1:47am    
Thanks!
List<string> MyKeyWords = GetKeywords();
var allDirectories = new DirectoryInfo("Path").GetDirectories("*", SearchOption.AllDirectories);
lstView.ItemsSource = (from di in allDirectories from fi in di.GetFiles("*.txt") where HasKeyWordMatch(fi, MyKeyWords) select fi);


private bool HasKeyWordMatch(FileInfo fi, List<string> MyKeyWords)
{
try
{
StreamReader testTxt = new StreamReader(fi.FullName);
string allRead = testTxt.ReadToEnd();
testTxt.Close();
string regMatch = "string";
if (Regex.IsMatch(allRead, regMatch))
{
return true;

}
else
{
return false;
}


}
catch (Exception ex)
{
return false;
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900