PDA

Click to See Complete Forum and Search --> : GetDirectories


sinha
Jan 23rd, 2006, 03:43 PM
Hi!
I am writing my code in c#.

I have a Main directory and sub directories under it.

Say my main directory is "ABC" and subdirectories under it are "CP200", "CP201", "Errors", "Hello".

I have to write a code in C# to get the subdirectories starting with "CP" i.e my code should return "CP200" and "CP201".

How to achieve it?

Thanks,

Sid.

jmcilhinney
Jan 23rd, 2006, 03:58 PM
string[] folders = System.IO.Directory.GetDirectories(@"C:\ABC", "CP*");