public FtpResponse ReadResponse()
A call to the SendCommand must be made before calling this method. Use SendCommand and ReadResponse methods to implement custom FTP commands.
The State will be in Processing state if the response Group is 3, in Reading state if the response Group is 1 or in Ready state in other cases.
Shows how to use SendCommand and ReadResponse to send a command to an FTP server and read the response returned from the server.
using System; using System.Collections.Generic; using System.Text; using ComponentPro.Net; ... // Create a new Ftp instance. Ftp client = new Ftp(); // Connect to the FTP server. client.Connect("server"); // Authenticate. client.Authenticate("username", "password"); // Send command client.SendCommand("FEAT"); // Print out the response FtpResponse res = client.ReadResponse(); Console.WriteLine(res.RawResponse); // Disconnect. client.Disconnect();