In addition, I would mention that a recursive function is probably
called-for, to search all sub-directories, sub-directories of
sub-directories, etc. I don't think he needs a Regular Expression for the
type of search he is conducting. The Directory.GetFiles() and
DirectoryInfo.GetFiles() methods can use a search patttern with the "*" and
"?" wildcards.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:D1**********************************@microsof t.com...
The normal method is to loop through the FielInfo classes from the
DirectoryInfo class aimed at the directory in question. You then query
each
name for your pattern (Regex?).
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Piz" wrote:
Hi all.
I have the following problem.
I have to open a directory placed on the server, and get a list of
files that contains a certain string in the file name.
For example:
search string: "myfile.*"
Something like tool "find" of windows.
I found a function "findInFiles" but it doesn't works...don't know why.
Is there any other way? Or i have to build it by myself?
Thanks all