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

标签 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);

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

最佳答案

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

关于c# - 如何从 Windows Phone 8.1 中的设备日历中删除约会,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27171046/

相关文章:

windows-8 - Windows Phone 8.1 WINRT 应用程序中何时触发激活的事件

c# - 应用程序关闭 Windows Phone 时析构函数崩溃

c# - 防止使用默认构造函数

c# - PropertyGrid 在 UITypeEditor 或 TypeConverter 的帮助下编辑后执行操作以更改其他属性

C# 语音识别

c# - TimeOut Expired 自带 SetResultTransformer() 方法

c# - 尝试配置 NServiceBus 以使用 NHibernate 持久性时出现异常

c# - Cortana 回复而不是应用程序启动

c# - Windows 电话 8.1 IRC

c# - 通过 Facebook Graph API 获取照片总数