string dataFileName="指定目录的字符串";
DirectoryInfo cdDirectory = new DirectoryInfo(Path.GetDirectoryName(dataFileName));
DirectoryInfo[] dirs = cdDirectory.GetDirectories();
if(dirs.Lenght>0){
//存在子目录
}
遍历文件,然后用System.IO.Directory.Exists(folderPath);来判断是否存在