gpt4 book ai didi

c# - 请求失败。远程服务器返回错误 : (401) Unauthorized

转载 作者:太空宇宙 更新时间:2023-11-03 11:26:01 24 4
gpt4 key购买 nike

我正在使用 EWS 以访问电子邮件帐户的收件箱。但我不断收到此错误:

The request failed. The remote server returned an error: (401) Unauthorized.

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Credentials = new WebCredentials("account@company.net","password","domain");
service.Url = new Uri("https://webpage.net/EWS/exchange.asmx");
//SearchFilter searchFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, true));
ItemView view = new ItemView(10);
FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox,view);//i get the error in this line of code

foreach (Item item in findResults.Items)
{
Console.WriteLine(item.Subject);
}

最佳答案

@company.net 正在破坏它。

关于c# - 请求失败。远程服务器返回错误 : (401) Unauthorized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9315217/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com