예제 #1
0
 public void GoSearch(PCDir dir)
 {
     dir.FileNames.ToList().ForEach(s =>
     {
         var actor = Context.ActorOf<FileScanner>();
         SeatchObj so = new SeatchObj();
         so.Path = s;
         so.SearchStr = dir.SearchText;
         actor.Tell(so, Self);
     });
 }
예제 #2
0
 private void ScanForText(SeatchObj search)
 {
     //System.IO.FileStream fs = new System.IO.FileStream(search.Path, System.IO.FileMode.Open);
     string allText = System.IO.File.ReadAllText(search.Path);
     if (allText.Contains(search.SearchStr))
     {
         //search.OnResultFound(search.Path);
         Sender.Tell(search.Path, Self);
     }
     else
         Sender.Tell(string.Empty, Self);
 }