如何从Windows Phone 8.1中的设备日历中删除约会

时间:2014-11-27 12:40:00

标签: c# windows-phone-8.1

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

错误消息:

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))

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

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

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

1 个答案:

答案 0 :(得分:0)

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