Tag: 通知

Windows 10中桌面应用程序的Toast通知中出现意外行为

我从Windows 8.1开始使用桌面应用程序的Toast通知,但是在Windows 10中使用了新的操作中心,我遇到了一些意想不到的行为。 当用户不对吐司做任何事情时,它只是消失而不去动作中心( ToastNotification.Dismissed是ToastDismissalReason.TimedOut )。 我不知道它是否与我在win32应用程序中使用它有关,但是Windows Universal App中的相同Toast在超时时会进入操作中心。 有一点需要注意的是,我没有为我的win32应用程序注册AppUserModelID ,就像在W8.1中需要它一样,它似乎不再是强制性的。 我仍然使用注册的身份证进行测试,并且我有相同的popblem。 那么,如何防止吐司在超时时不进入动作中心? 这是一个重现问题的极简主义代码(控制台应用程序): using Windows.Data.Xml.Dom; using Windows.UI.Notifications; namespace ToastDesktop { internal class Program { /// Add in the .csproj in the where is: /// 10.0.10240.0 /// /// Reference to add : /// – Windows.UI /// – Windows.Data private static void Main(string[] args) { string […]

数据库更新后如何通知我的程序?

我有一个C#程序,它在SQL Server数据库中查询某些值。 目前,应用程序每分钟查询一次数据库,以确保该表是最新的。 我希望能够做的是只在数据库被更改/更新时才进行查询。 如何在数据库中更新某些内容后如何通知我的程序? 谢谢

委派任务并在完成时收到通知(在C#中)

从概念上讲,我想完成以下操作,但却无法理解如何在C#中正确编码: SomeMethod { // Member of AClass{} DoSomething; Start WorkerMethod() from BClass in another thread; DoSomethingElse; } 然后,当WorkerMethod()完成时,运行以下命令: void SomeOtherMethod() // Also member of AClass{} { … } 任何人都可以举一个例子吗?