LDAP Client.Net

Client.Connect Method (String, Boolean)

Authenticate and bind to a directory server using unencrypted transport, and the emtpy string as both username and password.

[Visual Basic]
Public Sub Connect( _ 
   ByVal serverName As String, _ 
   ByVal useSSL As Boolean _ 
)
[C#]
public void Connect(
   string serverName,
   bool useSSL
);
[C++]
public: void Connect(
   String* serverName,
   bool useSSL
);
[JScript]
public function Connect(
   String serverName,
   bool useSSL
);

Parameters

serverName
Name of the server.
useSSL
true to bind using SSL; false to bind using unencrypted transport.

Example

[C#]
using System;
using LdapServices.Ldap;

namespace LDAPSampleCodeConsole
{
class SampleApp
{
static void Main(string[] args)
{
Client client = new Client();
client.Connect("directory.yourCompany.ca", true);
// This encrypted connection through Port.DefaultPort is ready for a search

// Disconnect
client.Disconnect();
}
}
}

See Also

Client Class | LdapServices.Ldap Namespace | Client.Connect Overload List