+1 vote
by (900 points)
edited

How to find ftp server supports NOOP(KeepAlive) command.

Applies to: Rebex FTP/SSL, Rebex SFTP

1 Answer

+1 vote
by (58.9k points)
edited

The best would be to use the Ftp.SendCommand and Ftp.ReadResponse to send the "NOOP" command to the server and then check whether it was successful (response code will start with "2" in this case). Just make sure to connect and authenticate to the FTP server before detecting the NOOP command support. Here is the code which does it:

Ftp ftp = new Ftp();

ftp.Connect("ftp_server");
ftp.Login("username", "password");

bool noopSupported = false;

ftp.SendCommand("NOOP");
var response = ftp.ReadResponse();
if (response.Group == 2)
{
    Console.WriteLine("NOOP command is supported.");
}
else
{
    Console.WriteLine("NOOP command not supported.");
}

ftp.Disconnect();
by (900 points)
edited

Thanks....

...