本文介绍了无法将附件添加到日历活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Office 365 Starter Project for ASP.NET MVC将日历添加到日历 https: //github/OfficeDev/O365-ASPNETMVC-Start .由于它需要事件ID,因此无法使用方法AddCalendarEventAsync添加.因此,我尝试使用以下代码更新事件:
I am trying to add attachment to calendar using Office 365 Starter Project for ASP.NET MVC github/OfficeDev/O365-ASPNETMVC-Start. As it requires event id I can't add using method AddCalendarEventAsync. So I'm trying to update event using below code:
var outlookServicesClient = await AuthenticationHelper.EnsureOutlookServicesClientCreatedAsync("Calendar"); var thisEventFetcher = outlookServicesClient.Me.Calendar.Events.GetById(selectedEventId); IEvent eventToUpdate = await thisEventFetcher.ExecuteAsync();但是'eventToUpdate'没有附件设置属性.请您检查一下并解释如何向日历添加附件.
But 'eventToUpdate' has not Attachment set property. Please could you check this and explain how to add attachment to calendar.
谢谢.
推荐答案var thisEventFetcher = outlookServicesClient.Me.Calendar.Events.GetById(eventID); Attachment attachment = new FileAttachment { Name = "test", ContentBytes = File.ReadAllBytes(@"D:\test.jpeg"), ContentType = "image/jpeg" }; await thisEventFetcher.Attachments.AddAttachmentAsync(attachment);
更多推荐
无法将附件添加到日历活动
发布评论