Solved

Issue with File search!!

Posted on 2009-04-05
2
188 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now