sev*_*evi 5 c# desktop-application toast windows-10
我有一个在 Windows 10 中运行的桌面应用程序,它创建的 ToastNotifications 也存储在操作中心中。我注意到,当我重新启动计算机时,通知仍然存在于操作中心中,因此我想在不再需要它们时通过我的应用程序将其删除。我想为此
使用ToastNotificationHistory方法。 
我的代码如下所示:   Remove
public static void RemoveNotificationByTag(string toastTag)
{
    ToastNotificationManager.History.Remove(toastTag, "TEST");
}
但这会导致这个异常:System.Exception: 'Element not found. (Exception from HRESULT: 0x80070490)'  
我之前发送的通知有一个Tag和一个Group值。  
调用RemoveGrouporGetHistory方法时我得到同样的异常。基本上,我似乎无法在没有得到相同异常的情况下调用 History 类中的任何方法
在 Windows 10 上,需要为每个方法提供 applicationId 参数。此外,您不仅必须指定 toast 标签,还必须指定其组。
像这样调用该方法是有效的:
ToastNotificationManager.History.Remove(toastTag, "TEST", appId);
| 归档时间: | 
 | 
| 查看次数: | 2297 次 | 
| 最近记录: |