On Jun 17, 1:48*pm, DavidM <Dav...@discussions.microsoft.com> wrote:
> Hi, does anyone know if I can scan a subdirectory using wildcards? *I donot
> see a way to do this using:
>
> * * * * * * * *string folder = @"C:\INPUT\CUSTOMERS\ID???BC.*"
>
> * * * * * * * * DirectoryInfo di = new DirectoryInfo(folder);
> * * * * * * * * FileInfo[] fileNames = di.GetFiles("AllInput_*.xml");
>
> Basically, I have lots of foldres under C:\INPUT\CUSTOMERS and I want to the
> .XML files I'm looking for only exists under the ID???BC folders. *So I
> wanted to dymanically get a list of all the ID???BC folders and then scan
> each one for the specified files. *
>
> I was trying to do this to avoid having to scan all folders. *Plus I need a
> dymaic list of all the ??? customers.
You can use
foreach(string folder in Directory.GetDirectories (@"C:\INPUT\CUSTOMERS
\ID???BC.*"))
foreach( string file in Directory.GetFiles( folder,
("AllInput_*.xml") ))
|