This is a pretty simple task, solved by using the classes
System.Net.FtpWebRequest
and
System.Net.WebResponse
. Your operation of downloading files from a directory would be a compound operation sequencing getting directory lists followed by a number of file downloading operations, optionally in a recursive manner. Those operations are represented by the static class
System.Net.WebRequestMethods.Ftp
. The operations you need are
System.Net.WebRequestMethods.Ftp.DownloadFile
and
System.Net.WebRequestMethods.Ftp.ListDirectory
or
System.Net.WebRequestMethods.Ftp.ListDirectoryDetails
.
See MSDN help pages with some code samples:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.net.ftpwebresponse.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp.aspx[
^].
Having all this information and code samples, you can consider the source code you need is almost done.
—SA