上载目录及其子目录 [英] uploading a directory and its sub directories

查看:117
本文介绍了上载目录及其子目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我如何在服务器uisng ftp上上传目录及其子目录吗,我可以上传FILE,但是文件夹又如何呢?

Can any one tell me how to upload a directory and its sub directories on server uisng ftp, i can upload a FILE but what about folders??

推荐答案

查看此链接:

它可以帮助您

http://khanrahim.wordpress.com /2010/09/03/file-download-upload-delete-in-ftp-location-using-c/ [
Look at this link:

It May help you

http://khanrahim.wordpress.com/2010/09/03/file-download-upload-delete-in-ftp-location-using-c/[^]


您将需要导航文件夹结构,必要时在远程服务器上创建目录,并分别上传每个文件.
You will need to navigate the folder structure, creating directories on the remote server where necessary, and upload each file individually.



您需要使用以下代码获取文件结构


Hi,
You need to get the filestructure using below code


string[] dirs=Directory.GetDirectories(path, "*.*", SearchOption.AllDirectories);



使用foreach,您必须创建该目录"dirs"中的所有目录.

然后您可以复制文件
一切顺利



And using foreach u have to create all the directories which in that array "dirs"

then u can copy the files
All the best


这篇关于上载目录及其子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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