wcf传输文件夹 [英] wcf transfer folders

查看:112
本文介绍了wcf传输文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一种wcf服务,用于在服务器之间传输文件.
现在我要传输文件文件夹(此文件夹中的所有文件夹和文件都可以传输).一旦获得了文件夹,它就应该能够与服务器之间来回传输.

我正在考虑,我想知道是否有一个简单的解决方案.
任何人都知道简单易行的方法吗?

I developed a wcf service for transfering file to and from server.
now I want to transfer filefolder ( all folders and files in this folder are subject to transfer ) . once given the folder it should able to transfer to and from server.

I am thinking about it and I would like to know if there is a simple solution.
in anyone know simple and easy way to do it?

thanks in advance!

推荐答案

我认为您具有在服务器之间传输文件的逻辑. .NET的System.IO命名空间具有GetFiles方法来获取特定文件夹中的所有文件夹和文件.

I think you''ve the logic for transferring file to and from server. System.IO namespace of .NET, has GetFiles method to fetch all folder and files in a particular folder.

string[] filePaths = Directory.GetFiles(@"c:\MyDir\", "*.doc",
                                         SearchOption.AllDirectories);



两种逻辑的结合,将为您提供一个简单的解决方案.



Combination of both logic, will give you a simple solution.


这篇关于wcf传输文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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