如何使用套接字来发送从WinRT的客户端(.NET 4.5)一个简单的消息,桌面服务器(.NET 4.0)?如何使用、客户端、桌面、消息

2023-09-04 04:16:16 作者:寒尘

我试图让使用C#聊天客户端 - 服务器应用程序。客户将是一个简单的Metro应用(WinRT中)和服务器将是老派的桌面应用程序。你能提供一个简单的code如何建立的,然后再如何从客户端发送一个世界你好消息给服务器,服务器和客户端之间的连接。我在寻找解决方案,这个问题从3天。我看了几乎快要StreamSockets,TcpClient的插座什么,仍然无法处理这个问题。不同平台的limitaions是最大的问题。 WinRT的不能使用TcpClient的对象,而旧的桌面应用程序不能创建StreamSockets到从服务器接收的数据。谢谢你在前进。

I am trying to make a Chat Client-Server application using C#. The Client will be a simple metro application (WinRT) and the server will be "oldfashioned" desktop application. Can you provide a simple code how to establish connection between the server and the client at first and then how to send a 'hello world' message from the Client to the Server. I am looking for solution for this problem from 3 days. I read almost anything about StreamSockets, TcpClient and sockets, and still cant handle the problem. The limitaions of the different platforms are the biggest problem. WinRT can not use TcpClient objects, and the old desktop applications can not create StreamSockets to receive the data from the server. Thank you in advance.

推荐答案

这是不可能的。微软已经明确地阻止WinRT的应用程序到其他应用程序上的本地主机进行通信。

this is not possible. microsoft has explicitly blocked communicating from winrt apps to other apps on localhost.