This shows you the differences between two versions of the page.
— |
public:howto:ldapsample [2007/11/30 14:30] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== How To Use LdapSend ====== | ||
+ | See next sample. Just create simple application with one button and one memo, and on button's onClick event call next code: | ||
+ | |||
+ | <code delphi> | ||
+ | procedure TForm1.Button53Click(Sender: TObject); | ||
+ | var | ||
+ | ldap: TLDAPsend; | ||
+ | l: TStringList; | ||
+ | begin | ||
+ | ldap:= TLDAPsend.Create; | ||
+ | l := TStringList.Create; | ||
+ | try | ||
+ | ldap.TargetHost := 'www.openldap.com'; | ||
+ | ldap.Login; | ||
+ | ldap.Bind; | ||
+ | l.Add('displayname'); | ||
+ | l.Add('description'); | ||
+ | l.Add('givenName'); | ||
+ | l.Add('*'); | ||
+ | ldap.Search('dc=OpenLDAP,dc=org', False, '(objectclass=*)', l); | ||
+ | memo1.Lines.Add(LDAPResultdump(ldap.SearchResult)); | ||
+ | ldap.Logout; | ||
+ | finally | ||
+ | ldap.Free; | ||
+ | l.Free; | ||
+ | end; | ||
+ | end; | ||
+ | </code> |