如何递归删除文件夹内有使用的FtpWebRequest的文件吗? [英] How to recursively delete a folder with the files within using 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屋!