如何将数据从C#MVC ASP.net应用程序发送到C#WPF应用程序

时间:2022-05-01 01:40:32

I am wondering how I can send information from a C# MVC Web Application to a C# Desktop Application.

我想知道如何将信息从C#MVC Web应用程序发送到C#桌面应用程序。

For example, I want to be able to send some strings from my web application that is hosted on some server to a client's personal computer where they will have my desktop application executable somewhere on their local machine. Also, I am trying to avoid the client having to open the desktop application (that will be running in the background) to click anything. I am wanting the desktop application to constantly be checking for data coming in from the web application. I would probably have a while() loop checking for that information in the desktop application and then once it has received data from the web application I will do stuff with it on the desktop side.

例如,我希望能够从托管在某个服务器上的Web应用程序向客户端的个人计算机发送一些字符串,在这些计算机上,我们的桌面应用程序可以在本地计算机上的某个位置执行。此外,我试图避免客户端必须打开桌面应用程序(将在后台运行)点击任何东西。我希望桌面应用程序不断检查来自Web应用程序的数据。我可能会在桌面应用程序中有一个while()循环检查该信息,然后一旦从Web应用程序接收到数据,我将在桌面端执行它。

Can anyone point me to some good examples of this or provide a simple example of this being done with some strings?

任何人都可以向我指出一些这方面的好例子,或者提供一个简单的例子,用一些字符串完成这个吗?

1 个解决方案

#1


0  

When thinking about this SignalR comes to mind, or perhaps implement in the MVC application a web hook and consume it in the WPF application.

想到这个SignalR时,或者想到在MVC应用程序中实现一个Web钩子并在WPF应用程序中使用它。

A good starting point for Signalr you can find here.

Signalr的一个很好的起点,你可以在这里找到。

#1


0  

When thinking about this SignalR comes to mind, or perhaps implement in the MVC application a web hook and consume it in the WPF application.

想到这个SignalR时,或者想到在MVC应用程序中实现一个Web钩子并在WPF应用程序中使用它。

A good starting point for Signalr you can find here.

Signalr的一个很好的起点,你可以在这里找到。