コード例 #1
0
        public void TestRecycleBinError()
        {
            DirectoryScanner scanner = new DirectoryScanner(@"C:\$Recycle.Bin\", "*.*", true, false, false, DateTime.Now - new TimeSpan(1, 0, 0, 0), DateTime.Now, true);

            IEnumerable<string> files = scanner.GetFiles();

            foreach (string file in files)
            {
                Log.Debug(file);
            }
        }
コード例 #2
0
ファイル: SearcherFactory.cs プロジェクト: gwicksted/Findall
        /// <summary>
        /// Constructs a new instance of <see cref="Searcher"/>
        /// </summary>
        /// <returns></returns>
        public Searcher ConstructSearcher()
        {
            DirectoryScanner scanner = new DirectoryScanner(Path, FileNamePattern, Recursive, Hidden, System, MinimumFileDate, MaximumFileDate, ForceLastWriteRefresh);

            Regex expression = new Regex(LinePattern);

            ILineMatcher lineMatcher = LinesNotMatching
                              ? (ILineMatcher) new LineNotMatchingMatcher(expression)
                              : new LineMatcher(expression);

            IFileMatcher fileMatcher = FilesNotMatching
                                           ? (IFileMatcher) new FileNotMatchingMatcher(lineMatcher)
                                           : new FileMatcher(lineMatcher);

            return new Searcher(scanner.GetFiles(), fileMatcher, new LineReader());
        }