如何在脱机服务器的情况下处理LdapConnection超时

时间:2012-10-22 06:39:54

标签: asp.net c#-4.0 openldap

我正在开发一个与活动目录交互并执行某些用户操作的网站。我希望在服务器脱机时处理超时情况。 我编码像这样

LdapConnection connection = new LdapConnection(new LdapDirectoryIdentifier(this._domain,    Convert.ToInt32(this._port)));
connection.SessionOptions.VerifyServerCertificate = new  VerifyServerCertificateCallback((con, cer) => true);
connection.SessionOptions.ProtocolVersion = 3; 
connection.AuthType = AuthType.Basic; 
connection.SessionOptions.SecureSocketLayer = true;
connection.Timeout = new TimeSpan(0, 0, 10);

0 个答案:

没有答案