internal static string GetDnFromPath(string fullPath) { IADsPathname pathName = new PathnameClass(); pathName.Set(fullPath, (int)ADS_SETTYPE_ENUM.ADS_SETTYPE_FULL); return(pathName.Retrieve((int)ADS_FORMAT_ENUM.ADS_FORMAT_X500_DN)); }
/// <summary> /// uses iadspathname to create paths in a standard way /// </summary> /// <param name="provider"></param> /// <param name="serverName"></param> /// <param name="path"></param> /// <returns></returns> internal static IADsPathname getADSPathname(string provider, string serverName, string path) { IADsPathname pathName = new PathnameClass(); if ((provider != null) && (provider.Length != 0)) { pathName.Set(provider, (int)ADS_SETTYPE_ENUM.ADS_SETTYPE_PROVIDER); } if ((serverName != null) && (serverName.Length != 0)) { pathName.Set(serverName, (int)ADS_SETTYPE_ENUM.ADS_SETTYPE_SERVER); } if ((path != null) && (path.Length != 0)) { // must supply a path pathName.Set(path, (int)ADS_SETTYPE_ENUM.ADS_SETTYPE_DN); } return(pathName); }
internal static string GetDnFromPath(string fullPath) { IADsPathname pathName = new PathnameClass(); try { pathName.Set(EscapeDnFilter(fullPath), (int)ADS_SETTYPE_ENUM.ADS_SETTYPE_FULL); return(pathName.Retrieve((int)ADS_FORMAT_ENUM.ADS_FORMAT_X500_DN)); } finally { Marshal.FinalReleaseComObject(pathName); } }
internal static string GetDnFromPath(string fullPath) { IADsPathname pathName = new PathnameClass(); pathName.Set(fullPath, (int)ADS_SETTYPE_ENUM.ADS_SETTYPE_FULL); return pathName.Retrieve((int)ADS_FORMAT_ENUM.ADS_FORMAT_X500_DN); }
/// <summary> /// uses iadspathname to create paths in a standard way /// </summary> /// <param name="provider"></param> /// <param name="serverName"></param> /// <param name="path"></param> /// <returns></returns> internal static IADsPathname getADSPathname(string provider, string serverName, string path) { IADsPathname pathName = new PathnameClass(); if ((provider != null) && (provider.Length != 0)) { pathName.Set(provider, (int)ADS_SETTYPE_ENUM.ADS_SETTYPE_PROVIDER); } if ((serverName != null) && (serverName.Length != 0)) { pathName.Set(serverName, (int)ADS_SETTYPE_ENUM.ADS_SETTYPE_SERVER); } if ((path != null) && (path.Length != 0)) { // must supply a path pathName.Set(path, (int)ADS_SETTYPE_ENUM.ADS_SETTYPE_DN); } return pathName; }