You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Peter Foot edited this page May 22, 2024
·
1 revision
The FTP classes follow the FtpWebRequest in the full .NET framework. Add a reference to InTheHand.dll and InTheHand.Net.dll to your project and add the following to your code file:-
using InTheHand.Net;
using System.Net;
using InTheHand.IO;
On startup e.g. in your Form constructor add:-
FtpWebRequest.RegisterPrefix();
This allows you to create FtpWebRequests using WebRequestCreate for any url with the ftp:// schema
To download a file you can use code like this:-
The default Method for an FtpWebRequest is RETR (download). To upload a file you would set Method to STOR and write the file contents to the stream retrieved from GetRequestStream(). The full list of available methods can be found in InTheHand.Net.WebRequestMethods.Ftp.