Novell.Directory.Ldap.LdapConnection.Read C# (CSharp) Method

Read() public method

Synchronously reads the entry for the specified distiguished name (DN) and retrieves all attributes for the entry.
LdapException if the object was not found ///
public Read ( System dn ) : LdapEntry
dn System The distinguished name of the entry to retrieve. /// ///
return LdapEntry
        public virtual LdapEntry Read(System.String dn)
        {
            return Read(dn, defSearchCons);
        }

Same methods

LdapConnection::Read ( LdapUrl toGet ) : LdapEntry
LdapConnection::Read ( LdapUrl toGet, LdapSearchConstraints cons ) : LdapEntry
LdapConnection::Read ( System dn, LdapSearchConstraints cons ) : LdapEntry
LdapConnection::Read ( System dn, System attrs ) : LdapEntry
LdapConnection::Read ( System dn, System attrs, LdapSearchConstraints cons ) : LdapEntry

Usage Example

Example #1
0
    // findACLValues() reads the entry to get it's ACL values
    public static void findACLValues(LdapConnection lc, String entry)
    {
        String[] returnAttrs = { "acl" };
        String attributeName;
        IEnumerator allValues;
        LdapAttribute attribute;
        LdapAttributeSet attributeSet;

        try
        {
            LdapEntry aclList = lc.Read( entry, returnAttrs );

            // printout entryDN's ACL values
            attributeSet = aclList.getAttributeSet();
            IEnumerator allAttributes = attributeSet.GetEnumerator();

            Console.WriteLine("    =========================================");
            Console.WriteLine("    entryDN's ACL values after modification:");
            Console.WriteLine("    =========================================");
            if (allAttributes.MoveNext())
            {
                attribute = (LdapAttribute)allAttributes.Current;
                attributeName = attribute.Name;
                allValues = attribute.StringValues;
                while(allValues.MoveNext())
                {
                    PrintACLValue((String)allValues.Current);
                }
            }
        }
        catch( LdapException e )
        {
            Console.WriteLine( "Error: ModdifyACL, " + e.ToString() );
            Environment.Exit(1);
        }
    }
All Usage Examples Of Novell.Directory.Ldap.LdapConnection::Read