Solved

Issue with File search!!

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

19 Experts available now in Live!

Get 1:1 Help Now