Solved

Issue with File search!!

Posted on 2009-04-05
2
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

726 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