如何使用Wcf服务的.Exe文件从Web服务器上载和下载? [英] How to use the Wcf Service of .Exe file upload and Download from Web server ?

查看:103
本文介绍了如何使用Wcf服务的.Exe文件从Web服务器上载和下载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了Windows应用程序.我部署了该项目,并得到了安装文件(.exe).如何使用WCF服务将设置文件上传到Web服务器,以及如何下载(或)直接将安装程序安装到客户端系统.

我是WCF服务的初学者.

I have developed a windows application. I deploy that Project and I got Setup file (.exe). How can I upload the setup file to web server using WCF services and how to download (or) direct setup Install to client System.

I am beginner in WCF service.

推荐答案

您好,

WCF是用于将不同的设备或应用程序连接到中央集线器(WCF中的服务器)的框架,用于在它们之间共享数据和服务. WCF不仅限于共享文本数据,还可以在网络之间共享二进制数据.

问题内部存在一个问题,您并不是要说要将数据存储在自己的服务器还是其他第三方系统上.我也无法对您的问题发表评论,不知道这是一个新功能还是一个错误,所以我在这里问了这个问题...

如果要将数据存储在您要管理的系统上.然后,您可以允许用户上载他们想要的任何文件.包括.exe文件,这些文件通常被认为是病毒的原因,因为许多病毒程序可以上传到服务器,一旦执行,就会在服务器上引起不同的问题.因此,如果您打算将文件上传到第三方,那么您就走错了方向.您可能需要先将.exe文件转换为blob(二进制数据)文件,然后再将其发送给它们,然后一旦提取,便以.exe格式提取二进制文件.但是如果您仍然想使用他们的系统.这样做的另一种方法是对要上传和下载的文件进行zip存档,然后在网络上进行共享.在用户可以下载裸.exe文件之前,该文件通常被应用程序阻止,或者大多数情况下,用户看到错误消息并且不下载文件.

由于您是WCF的新手,所以我可能会要求您阅读几个月前写的这篇文章.从那时起我还是一个新手,所以我不能强加任何东西给你先学.

创建要由互联设备通过Internet使用的Web服务 [ ^ ]

您将能够了解WCF框架,创建服务,使用这些服务以及为您的项目创建不同的客户端.您应该知道,每个客户端都使用与您编写的相同的主机和相同的代码功能.因此,您唯一需要担心的就是将数据存储在服务器上(主要是您为网络的WCF框架创建的集线器).上传文件的方法与在.NET中保存文件的方法相同.您可以从MSDN,CodeProject(是的,您所在的站点)或任何您知道的其他网站中获取代码.每个客户端将使用相同的代码,并且能够将数据存储在您的集线器空间中.
Hi,

WCF is a framework used to connect different devices or applications, to a central hub (the Server in the WCF) for sharing the data and services among them. WCF is just not limited to sharing the text data, but binary data can also be shared among the network.

There was a problem inside the question, you were not saying whether you wanted to store the data on your own server, or some other third-party system. I am also not able to comment on your question, I do not know whether this is a new feature or a bug so I asked it here...

If you want to store the data on the system that you''re admin of. Then you can allow the users to upload any file that they want to. Including .exe files, which are most of times thought to be a cause of virus, because many viral programs can be uploaded to the server causing different problems on the server once executed. So, if you''re going to upload the file on a third-party then you''re on the wrong side. You might want to convert the .exe file to a blob (binary data) file before sending it to them and then extract the binary back in format of .exe once extracting. But if you still want to use their system. Another method of doing so, is to make a zip archive of the files to be uploaded and downloaded and then shared on the network. Naked .exe files are mostly blocked by the application before user can be able to download it, or mostly users get to see an error message and do not download the file.

Since you''re new to WCF, I might ask you to read this article that I''ve written a few months back. I was also a newbie since then, so I cannot impose anything on you to learn first.

Creating a Web Service to be consumed by connected Devices via Internet[^]

You will be able to understand the WCF framework, creating services, consuming these services and creating different clients for your project. You should know, that each and every client uses the same host and same code functions that you''ve written. So only thing that you need to worry about is to store the data on the server (mainly the hub you''re creating for the WCF framework of your network). Uploading the file, is the same method as, Saving a file in .NET. You can get the code for that from MSDN, CodeProject (yes, this site you''re on) or from any other website that you know. Every client would use the same code, and will be able to store the data on your hub space.


这篇关于如何使用Wcf服务的.Exe文件从Web服务器上载和下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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