简体   繁体   English

如何在 C#、WPF 中的 Windows 中进行“推送通知”服务?

[英]How to make a “push notification” service in Windows in C#, WPF?

I have a WPF Browser application, written in C#.我有一个 WPF 浏览器应用程序,用 C# 编写。 In which have a process where i need to notify users of its status.在其中有一个过程,我需要通知用户其状态。 (ie notifying users when tasks are assigned to them). (即在分配任务时通知用户)。

The client doesn't want those notifications to be sent by mail, they want to have a tray icon that notifies each of the users when a "task" is assigned to them.客户不希望这些通知通过邮件发送,他们希望有一个托盘图标,当“任务”分配给他们时通知每个用户。 however, this application is going to be used by a large group of users and by making a notification system based on polling the server for a status change, would imply wasting a lot of traffic, as they need the notification to be received by the user as close to "real time" as possible.但是,此应用程序将被大量用户使用,并且通过基于轮询服务器以获取状态更改的通知系统,将意味着浪费大量流量,因为他们需要用户接收通知尽可能接近“实时”。

However, I could not find any examples of push notifications sent directly to any version of Windows.但是,我找不到任何直接发送到 Windows 版本的推送通知的示例。

To minimize bandwith used, I'd like to have an event listener on the server, and triggering the notifications from there, as it would just be one connection polling the server for changes.为了最大限度地减少使用的带宽,我希望在服务器上有一个事件监听器,并从那里触发通知,因为它只是一个轮询服务器以进行更改的连接。

How could I send the notifications from the server to each of the other users?如何将通知从服务器发送给其他每个用户?

Assuming you're using WCF to communicate between client/server, consider duplex services: http://msdn.microsoft.com/en-us/library/cc645027(VS.95).aspx假设您使用 WCF 在客户端/服务器之间进行通信,请考虑双工服务: http://msdn.microsoft.com/en-us/library/cc645027(VS.95).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM