C#应用程序/设备通讯解决方案 [英] C# Application/Device Comunication Solution

查看:130
本文介绍了C#应用程序/设备通讯解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我正在寻找解决我所寻找的应用程序/设备通信类型的最佳解决方案.这是我想要的交流方式的概述...

I am looking for the best solution to tackle the type of application/device communication that I am looking for. Here is an outline of what communication I want...

1.一个既是服务器又是客户端的WPF应用程序

1. A WPF application that is both a server and a client

2.用户输入计算机的本地IP,并运行另一个要连接的应用程序

2. User enters a local IP of the computer with another of the app running to connect to

3.可以在系统/应用程序之间发送和接收命令(例如,告诉运行在机器192.168.0.32上的应用程序以报告该机器的CPU使用率%)

3. Can send and receive commands between systems/applications (Ex. Tell application running at machine 192.168.0.32 to report CPU usage % of that machine)

有人说Windows Communication Foundation是解决方案,但是我不想要Web服务器,我只想使用TCP/IP并发送客户端侦听的文本命令,但这似乎是一个粗略的解决方案.

Some have said Windows Communication Foundation is solution but I don't want a web server needed, I was going to just use TCP/IP and send text commands that the client listens for but it seems like a crude solution.

欢迎任何建议,

干杯!

推荐答案


Carbongrip,


Hi Carbongrip,

> >但我不需要Web服务器,我只使用TCP/IP并发送客户端侦听的文本命令,但这似乎是一种粗略的解决方案.

我建议您可以使用Socket在WPF中实现客户端与服务器之间的通信.您可以参考以下文章并尝试来构建您的应用程序.

I suggest you can use Socket to implement client-server communication in WPF. You can refer the following articles and try  to build your application.

通过套接字进行通信:
https://code.msdn.microsoft.com/windowsdesktop/Communication-through-91a2582b
  
创建WPF聊天客户端服务器应用程序:
http://www.networkcomms.net/creating-a-wpf-chat-c​​lient -server-application/

Communication through Sockets:
https://code.msdn.microsoft.com/windowsdesktop/Communication-through-91a2582b
  
Creating A WPF Chat Client Server Application:
http://www.networkcomms.net/creating-a-wpf-chat-client-server-application/

应用的C#.NET套接字编程:
http://www.c-sharpcorner.com/UploadFile/ajyadav123 /applied-C-Sharp-net-socket-programming/

Applied C#.NET Socket Programming:
http://www.c-sharpcorner.com/UploadFile/ajyadav123/applied-C-Sharp-net-socket-programming/


注意:此响应包含对第三方万维网站点的引用. Microsoft为方便您而提供此信息. Microsoft不控制这些站点,也没有测试在这些站点上找到的任何软件或信息;所以, Microsoft无法对在此找到的任何软件或信息的质量,安全性或适用性做出任何陈述.使用Internet上发现的任何软件都存在固有的危险,Microsoft提醒您确保自己 从Internet上检索任何软件之前,请完全了解风险.


Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

最好的问候,

Yohann Lu

Yohann Lu


这篇关于C#应用程序/设备通讯解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆