需要实现推送通知以将消息推送到桌面客户端(不是网络/浏览器)

发布于 2024-12-17 11:44:10 字数 204 浏览 1 评论 0原文

我需要制作一个桌面应用程序(.NET/C#),它将驻留在系统托盘中。它的功能是接收来自服务器的推送通知,然后将其显示给用户。我有一个 Web 服务(同样在 .NET/C# ASMX 中)在我的服务器端运行,它不断轮询数据库以获取更改,因此最终我的 Web 服务始终具有更新/更改的数据。

您能否根据我的场景建议任何现有框架或解决方法,使我可以将推送通知从服务器发送到桌面客户端?

I need to make a Desktop Application (.NET/ C#) which will reside in the system tray. Its function is to receive push notification from the server and then to display it to the user. I have a webservice (again in .NET/ C# ASMX) running @ my server side which is polling db continuously for changes, so ultimately my webservice always have the updated/changed data.

Can you suggest any existing framework or workaround according to my scenario which can allow me to send push notifications from server to my desktop client?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

脸赞 2024-12-24 11:44:10

对于我们开发的应用程序,我使用 .NET Remoting 进行服务器推送。

服务器作为 Windows 服务运行,客户端通过远程处理连接到它。注册后,服务器可以将消息推送到桌面。这消除了轮询的需要。

一旦用户的应用程序从服务器收到需要刷新的消息,它就可以调用您的 Web 服务来获取数据。

For an application that we developed, I used .NET Remoting to do server-push.

The server runs as a Windows Service and clients attach to it via remoting. Once registered, the server can push messages out to the desktop. This eliminates the need for polling.

Once the user's app receives word from the server that it needs to refresh, it can then call your webservice to fetch the data.

林空鹿饮溪 2024-12-24 11:44:10

我认为你想要的是观察者设计模式的实现。这是来自 MSDN 的关于此的非常好的文档。这是一个相当高级的 .NET 编程主题,但确实值得一看。

问候,

Huske

I think what you want is the implementation of the Observer Design Pattern. Here is a pretty good documentation from MSDN regarding this. It is a rather advanced .NET programming topic, but something really worth looking at.

Regards,

Huske

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文