如何在 Windows Phone8.1 中从设备日历中删除应用程序

本文关键字:日历 删除 应用程序 Windows Phone8 | 更新日期: 2023-09-27 18:32:18

>当我尝试通过我的应用程序从设备日历中删除事件时,它显示错误

错误信息:

An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.ni.dll but was not handled in user code
Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

请查看下面 IAM 用于删除操作的代码

 AppointmentStore appointmentStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AppCalendarsReadWrite);
         AppointmentCalendar sysCal = await appointmentStore.GetAppointmentCalendarAsync(dCalendarID);
          await sysCal.DeleteAppointmentAsync(dCalendarEventID);

任何人都对此有任何想法,请帮助我。谢谢

如何在 Windows Phone8.1 中从设备日历中删除应用程序

您是否有权使用日历?在应用程序清单文件WMAppManifest.xml中查找ID_CAP_APPOINTMENTS