如何递归删除文件夹内有使用的FtpWebRequest的文件吗? [英] How to recursively delete a folder with the files within using FtpWebRequest?

查看:373
本文介绍了如何递归删除文件夹内有使用的FtpWebRequest的文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要删除FTP文件夹和递归的文件。

I want to delete a folder in FTP and it's files recursively.

任何示例代码我可以实现?

Any example code do I can implement?

推荐答案

可爱的小例子,你可以在这里找到:

Nice Little example you can find here:

http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx

在他们使用 WebRequestMethods.Ftp.UploadFile 类直接他们想要做什么样的操作的例子。

In the example they used WebRequestMethods.Ftp.UploadFile class to direct what kind of operation they want to do.

一旦你对父目录的句柄使用WebRequestMethods.Ftp.RemoveDirectory方法要删除:

Use the WebRequestMethods.Ftp.RemoveDirectory method once you have a handle on the parent directory you want to delete:

http://msdn.microsoft.com/en -us /库/ system.net.webrequestmethods.ftp.aspx

这篇关于如何递归删除文件夹内有使用的FtpWebRequest的文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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