473,473 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pattern argument in Directory.GetFiles() method

Are you only allowed to define one pattern? ie, "*.txt"? Or
can you define multiple patterns? ie, "*.txt; *.doc; *.xls"? If
you are allowed to do the latter, what is the syntax? I've tried
various seperators (;, :, etc) but none work and that leads me
to believe that this functionality isn't natively supported and that
I'd need to implement my own work around.

Can someone let me know if I'm missing something?

thnx,
Christoph
Nov 16 '05 #1
1 3694
http://msdn.microsoft.com/library/de...FilesTopic.asp

According to the MSDN, only '*' and '?' are wild card specifiers, you have
to code it :(

Have a look at this:
http://perso.3ie.org/yannick.lejeune...50433442793663

--
Guillaume BELMAS
Consultant 3IE (http://www.3ie.org)

"Christoph Boget" <jc*****@yahoo.com> wrote in message
news:uk**************@TK2MSFTNGP09.phx.gbl...
| Are you only allowed to define one pattern? ie, "*.txt"? Or
| can you define multiple patterns? ie, "*.txt; *.doc; *.xls"? If
| you are allowed to do the latter, what is the syntax? I've tried
| various seperators (;, :, etc) but none work and that leads me
| to believe that this functionality isn't natively supported and that
| I'd need to implement my own work around.
|
| Can someone let me know if I'm missing something?
|
| thnx,
| Christoph
|
|
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RobC | last post by:
I have noticed that in the directoryInfo class a method named GetFiles(String) accepts a wildcard pattern as a parameter and uses this to match file names that exist in a directory. I want to use...
2
by: ALI-R | last post by:
I am using the follwoing code to get all files which have txt as an extension but I get an error that your search pattern is not correct.it seems this fuction dosn't accept "*.txt" as search...
3
by: S. Han | last post by:
I'm using Directory.GetFiles to enumerate files in a directory. The problem is if you have to enumerate all files + subdirectories recursively, it takes too much memory, and it fails. Is there...
0
by: Hugo Mind | last post by:
Hi ng, If use this as pattern to my getfiles command --> "B7706c_2005020915253*.wav" and it returns me no files but if I use " B7706c_2005020915*.wav as the pattern then it retruns me files. ...
2
by: Alphonse Giambrone | last post by:
Is there a way to use multiple search patterns when calling Directory.GetFiles. For instance Directory.GetFiles("C:\MyFolder", "*.aspx") will return all files with the aspx extension. But what if...
4
by: Craig Vermeer | last post by:
Hi All, I have a program that's using the file system as a queuing mechanism, and it's consuming an inordinate amount of CPU time when the file system queue gets all that large (any more than a...
0
by: maxgasta | last post by:
Hello there, I'm getting crazy for "Directory.GetFiles" method It happens that when I'm getting a file list for a directory, the pattern matching is done "usually" on LongFileName base but...
4
by: John Dann | last post by:
Is there a way to limit the search pattern for Directory.Getfiles to an exact number of characters. For example I want to see all the files fitting the pattern "*.abc" but excluding "*.abcd". The...
7
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.