• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Issue with File search!!

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);
                    int count = listBox1.Items.Count;
                    textBox1.Text = count.ToString();

Open in new window

1 Solution
Do some of the files listed in Windows search are there in compressed folders (ZIP)???
yamurthyAuthor Commented:
Full Points!! :)
Yes there were indeed files from zip. i did not notice that and was wondering what was happeining. Thanks a lot :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now