Solved

Issue with File search!!

Posted on 2009-04-05
2
189 Views
Last Modified: 2013-12-17
Hi,
I wanted to write a small code to find all the files in the given path using some filter. The logic i implemented for this is shown in the code section below. When i use this and search, it does search but surprisingly not complete!!!
for example, if i search using the above logic with .chm filter, i get 91 files in the specified directories and subdirectories. but if i do a search using the windows search in the same path with the same filter i get around 95. i did see for many folders and the difference is too high some times!! any idea what happening?
string strFilter = "*.chm;";
                string[] m_arExt = strFilter.Split(';');
                foreach (string filter in m_arExt)
                {
                    string[] strFiles = Directory.GetFiles(@"D:\\Personal", filter, SearchOption.AllDirectories);
                    listBox1.Items.AddRange(strFiles);
                    int count = listBox1.Items.Count;
                    textBox1.Text = count.ToString();
                }

Open in new window

0
Comment
Question by:yamurthy
2 Comments
 
LVL 6

Accepted Solution

by:
HarryNS earned 250 total points
ID: 24074939
Do some of the files listed in Windows search are there in compressed folders (ZIP)???
0
 
LVL 1

Author Closing Comment

by:yamurthy
ID: 31566916
Full Points!! :)
Yes there were indeed files from zip. i did not notice that and was wondering what was happeining. Thanks a lot :)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question