调用 Send 方法之前必须设置 Path 属性。

Pokeeeer 2015-08-25 09:57:29
public void DownloadAttachments(string itemID, string folder)
{
ExchangeServiceBinding esb = new ExchangeServiceBinding();
PathToUnindexedFieldType[] ptufta = new PathToUnindexedFieldType[2];

ptufta[0] = new PathToUnindexedFieldType();
ptufta[0].FieldURI = UnindexedFieldURIType.itemAttachments;
ptufta[1] = new PathToUnindexedFieldType();
ptufta[1].FieldURI = UnindexedFieldURIType.itemHasAttachments;

ItemResponseShapeType irst = new ItemResponseShapeType();

irst.BaseShape = DefaultShapeNamesType.IdOnly;
irst.AdditionalProperties = ptufta;

ItemIdType[] biita = new ItemIdType[1];

biita[0] = new ItemIdType();
biita[0].Id = itemID;

//get the items

GetItemType git = new GetItemType();

git.ItemShape = irst;
git.ItemIds = biita;

GetItemResponseType girt = esb.GetItem(git);//这句抛出异常:调用 Send 方法之前必须设置 Path 属性。

if (girt.ResponseMessages.Items[0].ResponseClass != ResponseClassType.Success)
return;

/*…………………………………………*/


有人知道是什么问题吗?
...全文
1296 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Pokeeeer 2015-08-27
  • 打赏
  • 举报
回复
自己顶一下。。。

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧