[不是问题]在计算机之间使用WCF通过互联网发送数据 [英] [Not a question] Sending data over the internet using WCF between computers

查看:95
本文介绍了[不是问题]在计算机之间使用WCF通过互联网发送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了几天才能得到一些工作,但没有成功,所以我已经达到了我想直接问别人的地步。我试图在一台计算机上创建一个具有中央服务器/响应器的应用程序,该计算机具有我需要的数据,另一台计算机上的客户端将代码发送到服务器,然后服务器将对其进行解密,然后发送将所需数据返回给客户端。将有多个客户端访问一个服务器,它只需要发送相当小的字符串(最长的可能是图像数据)



ClientA ------- ----- 01005 ------------ / Server \

ClientB ------------ 01003 ------ ----- |服务器| - 返回任何客户端发送的请求

ClientC ------------ 03007 ----------- \Server /



每个'用户'都有一个在请求中发送的ID,其形式如下:

< ;用户[代码] GT; 
< CodeProject [01005]>



有人可以用WCF写一些代码来帮助我完成这项工作吗?它需要做的就是拥有一个可以多次使用的客户端和一个服务器作为控制台应用程序。基本上来回简单的字符串。我知道这有点大问题,但我找不到任何可行的方法。非常感谢你!

解决方案

你可以在很多地方找到最简单代码示例的介绍,但为什么不首先查看MSDN文档呢?你可以在这里开始: http://msdn.microsoft.com/en-us/library/ dd936243.aspx [ ^ ]。



提供完整的演示样本。



-SA

I have been trying for a few days to get something working but have had no success so I have got to the the point where I want to ask someone directly. I am trying to make an application that has a central server/responder on a computer that has the data I need and a client on another computer that will send a code over to the server which will then be deciphered by the server which will then send the required data back to the client. There will be multiple clients accessing the one server and it only needs to send quite small strings (the longest probably being image data)

ClientA ------------01005------------/Server\
ClientB ------------01003----------- | Server |- Return to whichever client sent request
ClientC ------------03007----------- \Server/

Each 'user' will have an ID that is sent in the request which will be formed like this:

<user[code]>
<CodeProject[01005]>


Could someone please write me a bit of code using WCF to help me accomplish this? All it needs to do is have a client that can be used multiple times and a single server as a console application. Simple back and forth strings basically. I know it is a bit of a big ask but I can't find anything that will work. Thank you so much!

解决方案

You can find some introduction with simplest code sample in many places, but why not looking at MSDN documentation first? You can start, say, here: http://msdn.microsoft.com/en-us/library/dd936243.aspx[^].

A complete demo sample is available.

—SA


这篇关于[不是问题]在计算机之间使用WCF通过互联网发送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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