自动发现期间EWS AutodiscoverLocalException和其他异常 [英] EWS AutodiscoverLocalException and other exceptions during Autodiscover

查看:101
本文介绍了自动发现期间EWS AutodiscoverLocalException和其他异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


下面的代码抛出
> AutodiscoverLocalException 当凭据错误时。是否可以识别哪个参数错误,如用户名,密码或域名?

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()

        {

           

             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;

        }

   private ExchangeService CreateExchangeService()
        {
           
             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.


这篇关于自动发现期间EWS AutodiscoverLocalException和其他异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆