Beispiel #1
0
        //Override
        public int GetEntriesCount()
        {
            int returnError;

            try
            {
                returnError = LdapClientLibrary.ldap_count_entries(this._connection.GetIntPtr(), this._message);
                return(returnError);
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }
Beispiel #2
0
        public List <ILdapEntry> GetEntries()
        {
            int numberEntries           = LdapClientLibrary.ldap_count_entries(this._connection.GetIntPtr(), this._message);
            List <ILdapEntry> entryList = new List <ILdapEntry>(numberEntries);

            if (numberEntries > 0)
            {
                try
                {
                    IntPtr pEntry = LdapClientLibrary.ldap_first_entry(this._connection.GetIntPtr(), this._message);
                    while ((pEntry != null) && (pEntry != IntPtr.Zero))
                    {
                        entryList.Add(new LdapEntry(this, pEntry));
                        pEntry = LdapClientLibrary.ldap_next_entry(this._connection.GetIntPtr(), pEntry);
                    }
                }
                catch (Exception exception)
                {
                    throw exception;
                }
            }
            return(entryList);
        }