无法将附件添加到日历活动

编程入门 行业动态 更新时间:2024-10-10 07:32:17
本文介绍了无法将附件添加到日历活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用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);

更多推荐

无法将附件添加到日历活动

本文发布于:2023-11-09 04:05:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571355.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:附件   日历

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!