Exemple #1
0
 private void StartSearch(string filePath)
 {
     try {
         if (continue_)
         {
             if (rbname.Checked)
             {
                 search.SearchInSingleDirByName(filePath, aa);
             }
             else if (rbdate.Checked)
             {
                 search.SearchInSingleDirByDate(filePath, dtpfrom.Value, dtpto.Value, aa, da);
             }
             else if (rbsize.Checked)
             {
                 search.SearchInSingleDirBySize(filePath, (long)nudfrom.Value, (long)nudto.Value, aa, sa);
             }
             else if (rbword.Checked)
             {
                 search.SearchInSingleDirByWord(filePath, aa);
             }
             if (cbsubdir.Checked)
             {
                 foreach (string ss in Directory.GetDirectories(filePath))
                 {
                     if (!IsSSInExculdeDir(ss))
                     {
                         temp = new FileInfo(ss);
                         if (!temp.Attributes.ToString().Contains("Hidden, System, Directory"))
                         {
                             previous = lvresults.Items.Count;
                             //   MessageBox.Show( ss );
                             if (!cbhiddendir.Checked && cbsystemfolder.Checked &&
                                 !(temp.Attributes.ToString().Contains("Hidden")))
                             {
                                 StartSearch(ss);
                             }
                             else if (cbhiddendir.Checked && !cbsystemfolder.Checked &&
                                      !(temp.Attributes.ToString().Contains("System")))
                             {
                                 StartSearch(ss);
                             }
                             else if (cbhiddendir.Checked && cbsystemfolder.Checked)
                             {
                                 StartSearch(ss);
                             }
                             else if (!cbsystemfolder.Checked && !cbhiddendir.Checked &&
                                      !(temp.Attributes.ToString().Contains("System")) &&
                                      !(temp.Attributes.ToString().Contains("Hidden")))
                             {
                                 StartSearch(ss);
                             }
                             //if ( lvresults.Items.Count > previous )
                             //    lvresults.AutoResizeColumns( ColumnHeaderAutoResizeStyle.ColumnContent );
                         }
                     }
                 }
             }
         }
     }
     catch { }
 }