Prince OfThief Prince OfThief - 1 year ago 133
C# Question

How to recursively delete a folder with the files within using FtpWebRequest?

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

Any example code do I can implement?

Answer Source

Nice Little example you can find here:

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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download