AjaxControlToolkit.AjaxFileUploadHelper.IsSubDirectory C# (CSharp) Method

IsSubDirectory() static private method

static private IsSubDirectory ( string parentDirectory, string childDirectory ) : bool
parentDirectory string
childDirectory string
return bool
        static bool IsSubDirectory(string parentDirectory, string childDirectory)
        {
            var directoryInfo = new DirectoryInfo(childDirectory).Parent;
            while(directoryInfo != null) {
                if(directoryInfo.FullName == parentDirectory)
                    return true;
                directoryInfo = directoryInfo.Parent;
            }

            return false;
        }