private static FindSubFolderPath ( string rootFolderPath, string folderName ) : string | ||
rootFolderPath | string | |
folderName | string | |
리턴 | string |
private static string FindSubFolderPath(string rootFolderPath, string folderName)
{
var directory = new DirectoryInfo(rootFolderPath);
directory = (directory.GetDirectories("*", SearchOption.AllDirectories)
.Where(folder => folder.Name.ToLower() == folderName.ToLower()))
.FirstOrDefault();
if (directory == null)
{
throw new DirectoryNotFoundException();
}
return directory.FullName;
}