How do I check if a directory exists within another directory

A

aine_canby

Hi,

How do I check if a directory exists within another directory?

For example

C:/aaa C:/Aaa = true
C:/aaa/ C:/Aaa/bb = true
C:/aaa/ C:/Aaa/bb/cc = true
C:/bb/ C:/aa/ = false

Thanks,

Aine
 
H

Hilton

For these simple cases, how about:

if (dir.ToLower().StartsWith (subDir.ToLower()))
{}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top