?
Solved

Multiple wildcard queries for FileInfo.getFiles

Posted on 2004-03-26
3
Medium Priority
?
930 Views
Last Modified: 2008-01-09
In a strange twist, the FileInfo.getFiles method does not respond well to queries for multiple wildcards, say for all image files (*.bmp, *.jpg, *.gif, ...).

Using multiple wildcards simply returns nothing, which I find pretty strange since I would have expected the object's behavior to be closely tied to Window's native file search.

So is there a quick an easy way to do this, or do I have to do multiple queries for each file extension?
0
Comment
Question by:mannycalaveras
[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
3 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 250 total points
ID: 10690016
You can write your file to the list box for example and then loop through the lb to read ieach file and then get info. While writing to the list box you can filter for files that you need (bmp for example)


        Dim FI As New FileInfo(Directory.GetCurrentDirectory & "\" & lst.Text)
0
 
LVL 1

Author Comment

by:mannycalaveras
ID: 10691231
You mean search for all files and filter myself according to each file's extension?

That's a workable option. I don't like searching for file extensions separately since they do not end up being in alphabetical order this way...

I'll check that out. Although I would appreciate a definitive answer on whether or not there is a way integrated in .NET to do it without doing workarounds like that.
0
 
LVL 1

Author Comment

by:mannycalaveras
ID: 10706737
Seems that there isn't a better answer than doing it all manually, I'll just deal with it this way.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

752 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