Asp.net 脱机服务器情况下如何处理LdapConnection超时
我在一个与active directory交互并执行某些用户操作的网站上工作。我想在服务器离线的情况下处理超时情况。 我是这样编码的Asp.net 脱机服务器情况下如何处理LdapConnection超时,asp.net,c#-4.0,openldap,Asp.net,C# 4.0,Openldap,我在一个与active directory交互并执行某些用户操作的网站上工作。我想在服务器离线的情况下处理超时情况。 我是这样编码的 LdapConnection connection = new LdapConnection(new LdapDirectoryIdentifier(this._domain, Convert.ToInt32(this._port))); connection.SessionOptions.VerifyServerCertificate = new Ver
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);
我想在超时的情况下向用户显示一条消息。当连接超时时,是否存在任何类型的异常类型或事件处理程序。类似这样的内容:?