Mar 30, 2012 at 10:33 PM
Edited Mar 30, 2012 at 10:37 PM
The sandcastle docs are probably (mostly at least) inaccurate. I haven't updated any of them in a while. There is no real documentation short of what's in the Documentation section of the site. I know that's a big issue however I haven't had the time to
really sit down and write any (I've had a lot going on with work and with personal time).
To do what you have described you will want to make use of the FtpDirectoryInfo and FtpFileInfo classes. In the FtpClient object, there exists an object named CurrentDirectory which is a FtpDirectoryInfo object. The properties of the two classes should be
mostly self explanatory.
In regards to SSL, the Explicit option will setup a secure stream once the connection is made (before credentials are sent) using the AUTH TLS/SSL command. This method will fall back to no encryption in the event that the server doesn't support. There are
two events in FtpClient that you need to handle: InvalidCertificate and SecurityNotAvailable. The invalid certificate is fired when there is a problem with the SSL certificate (name mismatch, un-trusted authority, etc...). The event args will allow you to
cancel out an exception being thrown. The SecurityNotAvailable event is fired when the server doesn't support AUTH TLS/SSL and the event args have a property that allow you to abort the connection before credentials are sent in plain text to the server.
The Implicit SSL option assumes you are connecting to a port on the server setup for SSL only (typically 990). It uses a secure stream straight from the start however the added value over Explicit SSL in terms of security is probably debatable since
nothing of substantial value is exchanged between the client and server in plain text when Explicit SSL is used if you handle the SecurityNotAvailable event properly.
With that said, either implicit or explicit security are viable options. Use the one that fits your use case.
Sorry for the late response, let me know if you have any other questions. If you send me an email via the codeplex contact option in my profile I can probably dig up some more complete examples from my test code.