Export (0) Print
Expand All

LdapConnection Class

The LdapConnection class creates a TCP/IP or UDP LDAP connection to Microsoft Active Directory Domain Services or an LDAP server.

System.Object
  System.DirectoryServices.Protocols.DirectoryConnection
    System.DirectoryServices.Protocols.LdapConnection

Namespace:  System.DirectoryServices.Protocols
Assembly:  System.DirectoryServices.Protocols (in System.DirectoryServices.Protocols.dll)

public class LdapConnection : DirectoryConnection, 
	IDisposable

The LdapConnection type exposes the following members.

  NameDescription
Public methodLdapConnection(LdapDirectoryIdentifier)The LdapConnection(LdapDirectoryIdentifier) constructor creates an instance of the LdapConnection class using the specified directory identifier. The logon credentials and the Negotiate Authentication are used to connect to the LDAP server.
Public methodLdapConnection(String)The LdapConnection(String) constructor creates an instance of the LdapConnection class using the specified server.
Public methodLdapConnection(LdapDirectoryIdentifier, NetworkCredential)The LdapConnection(LdapDirectoryIdentifier, NetworkCredential) constructor creates an instance of the LdapConnection class using the specified directory identifier and network credentials. Negotiate Authentication is used.
Public methodLdapConnection(LdapDirectoryIdentifier, NetworkCredential, AuthType)The LdapConnection(LdapDirectoryIdentifier, NetworkCredential, AuthType) constructor creates an instance of the LdapConnection class using the specified directory identifier, network credentials, and authentication type.
Top

  NameDescription
Public propertyAuthTypeThe AuthType property contains the supported authentication types.
Public propertyAutoBindThe AutoBind property specifies whether an automatic bind is allowed.
Public propertyClientCertificatesThe ClientCertificates property specifies one or more client certificates to send for authentication. (Inherited from DirectoryConnection.)
Public propertyCredentialThe Credential property contains the network credentials for the object. (Overrides DirectoryConnection.Credential.)
Public propertyDirectoryThe Directory property specifies the domain or the server to which the connection should be made. (Inherited from DirectoryConnection.)
Public propertySessionOptionsThe SessionOptions property contains an LdapSessionOptions object that specifies the session options.
Public propertyTimeoutThe Timeout property contains the length of time, in seconds, before the LdapConnection times out. (Overrides DirectoryConnection.Timeout.)
Top

  NameDescription
Public methodAbortThe Abort method cancels the asynchronous request.
Public methodBeginSendRequest(DirectoryRequest, PartialResultProcessing, AsyncCallback, Object)The BeginSendRequest method sends data asynchronously to the server.
Public methodBeginSendRequest(DirectoryRequest, TimeSpan, PartialResultProcessing, AsyncCallback, Object)The BeginSendRequest method sends data asynchronously to the server.
Public methodBind()The Bind() method sends an LDAP bind using the current credentials.
Public methodBind(NetworkCredential)The Bind(NetworkCredential) method sends an LDAP bind using the specified NetworkCredential.
Public methodDispose()The Dispose() method closes and releases the LDAP handle.
Protected methodDispose(Boolean)The Dispose(Boolean) method closes the connection and optionally releases the LDAP handle.
Public methodEndSendRequestThe EndSendRequest method completes an asynchronous request.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeThe LdapConnection.Finalize method allows an LdapConnection object to attempt to free resources and perform other cleanup operations before the LdapConnection object is reclaimed by garbage collection. (Overrides Object.Finalize().)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetPartialResultsThe GetPartialResults method retrieves partial results of an asynchronous operation.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSendRequest(DirectoryRequest)The SendRequest method sends a single DirectoryRequest as an LDAP v3 operation. (Overrides DirectoryConnection.SendRequest(DirectoryRequest).)
Public methodSendRequest(DirectoryRequest, TimeSpan)The SendRequest method sends a single DirectoryRequest as an LDAP v3 operation.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

If the ClientCertificates property on the LdapConnection object and QueryClientCertificate property on the LdapSessionOptions object are both set, the certificate specified in the ClientCertificates property is ignored.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft