自动发现期间EWS AutodiscoverLocalException和其他异常 [英] EWS AutodiscoverLocalException and other exceptions during Autodiscover
问题描述
下面的代码抛出
The following code throws
AutodiscoverLocalException when credentials are wrong. Will it be possible to identify which parameter is wrong like username, password or Domain?    我们如何区分自动发现配置问题与 凭证或电子邮件地址是错误的。 How can we differentiate between Autodiscover configuration issues vs. the credentials or emailaddress is wrong .
private ExchangeService CreateExchangeService() private ExchangeService CreateExchangeService() 。 .
这篇关于自动发现期间EWS AutodiscoverLocalException和其他异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
跨度>的> AutodiscoverLocalException 当凭据错误时。是否可以识别哪个参数错误,如用户名,密码或域名?
{
ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
试试
{
exchangeService.TraceEnabled = true;
exchangeService.Credentials = new WebCredentials(" agent11000"," 1"" myCompany的跨度> 跨度> 强>的 <强> .COM");
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; exchangeService.AutodiscoverUrl(QUOT; 强> 的 agent1000@mycompany.com 强> <强>" ;, ValidateRedirectionUrlCallback);
}
catch(AutodiscoverLocalException ex1)
{
}
catch(Exception ex)
{
}
return exchangeService;
}
{
ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
try
{
exchangeService.TraceEnabled = true;
exchangeService.Credentials = new WebCredentials("agent11000", "1", "mycompany.com");
exchangeService.AutodiscoverUrl("agent1000@mycompany.com", ValidateRedirectionUrlCallback);
}
catch (AutodiscoverLocalException ex1)
{
}
catch (Exception ex)
{
}
return exchangeService;
}
推荐答案
不,这是不可能的,也不会。披露哪个参数不正确将是一个安全问题。
No, it is not possible and won't be. It would be a security issue to disclose which parameter is incorrect.