ASP.NET MVC 용 Office 365 Starter Project https://github.com/OfficeDev/O365-ASPNETMVC-Start 를 사용하여 일정에 첨부 파일을 추가하려고합니다 . 이벤트 ID가 필요하므로 AddCalendarEventAsync 메서드를 사용하여 추가 할 수 없습니다. 그래서 아래 코드를 사용하여 이벤트를 업데이트하려고합니다.
var outlookServicesClient = await AuthenticationHelper.EnsureOutlookServicesClientCreatedAsync("Calendar");
var thisEventFetcher = outlookServicesClient.Me.Calendar.Events.GetById(selectedEventId);
IEvent eventToUpdate = await thisEventFetcher.ExecuteAsync();
그러나 'eventToUpdate'에는 Attachment set 속성이 없습니다. 이것을 확인하고 캘린더에 첨부 파일을 추가하는 방법을 설명해 주시겠습니까?
감사합니다.
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);
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다