问题描述
下面的代码抛出 The following code throwsAutodiscoverLocalException 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和其他异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
跨度>的> AutodiscoverLocalException 当凭据错误时。是否可以识别哪个参数错误,如用户名,密码或域名?
{
ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
试试
{
exchangeService.TraceEnabled = true;
exchangeService.Credentials = new WebCredentials(" agent11000"," 1"" myCompany的跨度> 跨度> 强>的 " ;, 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("[email protected]", ValidateRedirectionUrlCallback);
}
catch (AutodiscoverLocalException ex1)
{
}
catch (Exception ex)
{
}
return exchangeService;
}
推荐答案