我正在尝试使用c#EWS测试我们的安全性设置:基本身份验证。
我正在使用以下几行进行连接
ExchangeService myService = new ExchangeService();
myService.Credentials = new NetworkCredential(userData.EmailAddress, userData.Password);
我正确的假设是基本身份验证而不是现代身份验证
答案 0 :(得分:0)
您还需要将url和凭据一起传递
ExchangeService myService = new ExchangeService()
{
Credentials = new WebCredentials(username, password),
Url = new Uri(exchangeUrl)
};
或者如果您想使用特定的交换版本,则可以使用like
var exchangeVersion = ExchangeVersion.Exchange2010_SP2; // or any valid version
ExchangeService myService = new ExchangeService(exchangeVersion)
{
Credentials = new WebCredentials(username, password),
Url = new Uri(exchangeUrl)
};
希望这会有所帮助。