Active Directory/Connect: Difference between revisions

Added F#
(Added F#)
Line 59:
eldap:close( Handle ).
</lang>
 
=={{header|F_Sharp|F#}}==
{{trans|C_sharp}}
<p>For Active Directory we use the library System.DirectoryServices</p>
<lang fsharp>let adObject = new System.DirectoryServices.DirectoryEntry("LDAP://DC=onecity,DC=corp,DC=fabrikam,DC=com")</lang>
<p>For your average LDAP server we use System.DirectoryServices.Protocol</p>
<p>For a minimal example we make an anonymous connect to the local machine on the well-known LDAP port 389
<lang fsharp>let ldapServer = new System.DirectoryServices.Protocols.LdapDirectoryIdentifier("127.0.0.1")
let connect = new System.DirectoryServices.Protocols.LdapConnection(ldapServer)
connect.Bind()</lang>
 
=={{header|Java}}==
Anonymous user