How can I determine if a subdirectory exists in C#?

user496949 picture user496949 · Dec 29, 2010 · Viewed 12.5k times · Source

In C#, how can one determine if a subdirectory exists?

Is this neccesary when calling CreateSubDirectory?

Answer

AsifQadri picture AsifQadri · Dec 29, 2010
if(System.IO.Directory.GetDirectories(path).Length>0)
{
//if this condition is true-->> Directory has sub-sirectories

}