static string GetParentDirByName(string path, string parentName)
{
var current = new DirectoryInfo(path);
while (current != null) {
if(String.Compare(current.Name, parentName, true) == 0)
return current.FullName;
current = current.Parent;
}
return String.Empty;
}