LdapConnection LdapConnection LdapConnection LdapConnection Class

Definition

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

public ref class LdapConnection : System::DirectoryServices::Protocols::DirectoryConnection, IDisposable
public class LdapConnection : System.DirectoryServices.Protocols.DirectoryConnection, IDisposable
type LdapConnection = class
    inherit DirectoryConnection
    interface IDisposable
Public Class LdapConnection
Inherits DirectoryConnection
Implements IDisposable
Inheritance
Implements

Remarks

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.

Constructors

LdapConnection(LdapDirectoryIdentifier) LdapConnection(LdapDirectoryIdentifier) LdapConnection(LdapDirectoryIdentifier) LdapConnection(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.

LdapConnection(LdapDirectoryIdentifier, NetworkCredential) LdapConnection(LdapDirectoryIdentifier, NetworkCredential) LdapConnection(LdapDirectoryIdentifier, NetworkCredential) LdapConnection(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.

LdapConnection(LdapDirectoryIdentifier, NetworkCredential, AuthType) LdapConnection(LdapDirectoryIdentifier, NetworkCredential, AuthType) LdapConnection(LdapDirectoryIdentifier, NetworkCredential, AuthType) LdapConnection(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.

LdapConnection(String) LdapConnection(String) LdapConnection(String) LdapConnection(String)

The LdapConnection(String) constructor creates an instance of the LdapConnection class using the specified server.

Properties

AuthType AuthType AuthType AuthType

The AuthType property contains the supported authentication types.

AutoBind AutoBind AutoBind AutoBind

The AutoBind property specifies whether an automatic bind is allowed.

ClientCertificates ClientCertificates ClientCertificates ClientCertificates

The ClientCertificates property specifies one or more client certificates to send for authentication.

(Inherited from DirectoryConnection)
Credential Credential Credential Credential

The Credential property contains the network credentials for the object.

Directory Directory Directory Directory

The Directory property specifies the domain or the server to which the connection should be made.

(Inherited from DirectoryConnection)
SessionOptions SessionOptions SessionOptions SessionOptions

The SessionOptions property contains an LdapSessionOptions object that specifies the session options.

Timeout Timeout Timeout Timeout

The Timeout property contains the length of time, in seconds, before the LdapConnection times out.

Methods

Abort(IAsyncResult) Abort(IAsyncResult) Abort(IAsyncResult) Abort(IAsyncResult)

The Abort(IAsyncResult) method cancels the asynchronous request.

BeginSendRequest(DirectoryRequest, PartialResultProcessing, AsyncCallback, Object) BeginSendRequest(DirectoryRequest, PartialResultProcessing, AsyncCallback, Object) BeginSendRequest(DirectoryRequest, PartialResultProcessing, AsyncCallback, Object) BeginSendRequest(DirectoryRequest, PartialResultProcessing, AsyncCallback, Object)

Sends data asynchronously to the server.

BeginSendRequest(DirectoryRequest, TimeSpan, PartialResultProcessing, AsyncCallback, Object) BeginSendRequest(DirectoryRequest, TimeSpan, PartialResultProcessing, AsyncCallback, Object) BeginSendRequest(DirectoryRequest, TimeSpan, PartialResultProcessing, AsyncCallback, Object) BeginSendRequest(DirectoryRequest, TimeSpan, PartialResultProcessing, AsyncCallback, Object)

Sends data asynchronously to the server.

Bind() Bind() Bind() Bind()

The Bind() method sends an LDAP bind using the current credentials.

Bind(NetworkCredential) Bind(NetworkCredential) Bind(NetworkCredential) Bind(NetworkCredential)

The Bind(NetworkCredential) method sends an LDAP bind using the specified NetworkCredential.

Dispose() Dispose() Dispose() Dispose()

The Dispose() method closes and releases the LDAP handle.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

The Dispose(Boolean) method closes the connection and optionally releases the LDAP handle.

EndSendRequest(IAsyncResult) EndSendRequest(IAsyncResult) EndSendRequest(IAsyncResult) EndSendRequest(IAsyncResult)

The EndSendRequest(IAsyncResult) method completes an asynchronous request.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

The 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.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetPartialResults(IAsyncResult) GetPartialResults(IAsyncResult) GetPartialResults(IAsyncResult) GetPartialResults(IAsyncResult)

The GetPartialResults(IAsyncResult) method retrieves partial results of an asynchronous operation.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SendRequest(DirectoryRequest) SendRequest(DirectoryRequest) SendRequest(DirectoryRequest) SendRequest(DirectoryRequest)

The SendRequest(DirectoryRequest) method sends a single DirectoryRequest as an LDAP v3 operation.

SendRequest(DirectoryRequest, TimeSpan) SendRequest(DirectoryRequest, TimeSpan) SendRequest(DirectoryRequest, TimeSpan) SendRequest(DirectoryRequest, TimeSpan)

The SendRequest(DirectoryRequest, TimeSpan) method sends a single DirectoryRequest as an LDAP v3 operation.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to