Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        /// <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);
            }
        }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
        /// <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;
        }