Hello,
I use this code to add users to LDAP directory. I always get the error
"The
server is not operational". Could you please tell me what is wrong?
strServer = "localhost";
strPort = "389";
strUser = "CN=FTPUser,O=FTP,C=US";
strPath = String.Concat("LDAP://", strServer,":", strPort, "/", strUser);
AuthTypes = AuthenticationTypes.Signing |AuthenticationTypes.Sealing
|AuthenticationTypes.Secure;
// Bind to user object using LDAP port.
try
{
objUser = new DirectoryEntry(strPath, null, null, AuthTypes);
objUser.RefreshCache();
}
catch (Exception e)
{
Console.WriteLine("Error: Bind failed.");
Console.WriteLine(" {0}.", e.Message);
return true;
}
--
I am using the free version of SPAMfighter for private users.
It has removed 19254 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!