This topic briefly presents some of the simpler overloads of the static methods of the QuickFtp class; for a complete list, see the class's methods in the reference documentation. Also, see the appropriate topics under Task-Based Help for more complete examples.
The methods
Only the simpler overloads ar presented here. Other overloads let you specify user names and passwords, authentication methods, and callbacks (certificate required/received, item/byte progression).
The Send method lets you send files to an FTP server. The following specifies the hostname of the FTP server to connect to, the remote destination folder, and the files to send (searching recursively).
VB.NET |
Copy Code |
QuickFtp.Send("ftp.server.com", "\public", "d:\test\test.txt") |
C# |
Copy Code |
QuickFtp.Send("ftp.server.com", @"\public", @"d:\test\test.txt"); |
The Receive method lets you retrieve files from an FTP server. The following specifies the FTP server hostname, the local folder in which to place the file, and the file to receive.
VB.NET |
Copy Code |
QuickFtp.Receive("ftp.server.com", "d:\", "test\test.txt") |
C# |
Copy Code |
QuickFtp.Receive("ftp.server.com", @"d:\", @"test\test.txt"); |
The GetFtpContents method instructs the FTP server to list its contents. The following specifies the FTP server hostname, the remote folder to list, and no filters.
VB.NET |
Copy Code |
Dim items As QuickFtpItem() = QuickFtp.GetFtpContents("ftp.server.com", "\", Nothing) |
C# |
Copy Code |
QuickFtpItem[] items = QuickFtp.GetFtpContents("ftp.server.com", @"\", null); |
Finally, the Delete method deletes items from an FTP server.
VB.NET |
Copy Code |
QuickFtp.Delete("ftp.server.com", False, "test\test.txt") |
C# |
Copy Code |
QuickFtp.Delete("ftp.server.com", false, @"test\test.txt"); |
Remarks
Overloads which do not have a recursive parameter automatically perform their operation recursively.