Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows WPF Framework file key , +
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 22-Nov-11 20:16pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Check my article here : hOOt - full text search engine[^]
  Permalink  
Comments
SAKryukov at 23-Nov-11 1:43am
   
Remember that one, a 5.
--SA
Mehdi Gholam at 23-Nov-11 1:47am
   
Thanks man.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
Comments
SAKryukov at 23-Nov-11 1:43am
   
Good links, a 5.
--SA
Wayne Gaylard at 23-Nov-11 1:47am
   
Thanks!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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;
                  }
}
  Permalink  

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

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 OriginalGriff 120
3 PIEBALDconsult 110
4 BillWoodruff 85
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 24 Nov 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100