I am using FTPWebRequest and FTPWebResponse to connect to an FTP server. This FTP server checks the number of failed logon attempts from a client, and temporarily bans a client if there are too many failed logon attempts in a specified time period. For the initial failed logon attempts, and also for any attempts after being banned, I get
"The remote server returned an error: (530) Not logged in."
If I try to connect to the FTP server manually (i.e. from a DOS prompt) after being banned, I get
c:\> ftp a.b.c.d
Connected to a.b.c.d.
530 Host w.x.y.z has been temporarily banned from the FTP server.
Connection closed by remote host.
w.x.y.z is the IP address of my local system.
Is there any way I can capture the text of the message
"530 Host w.x.y.z has been temporarily banned from the FTP server."
I need to be able to differentiate between a regular failed logon attempt ("Not Logged In") and one that was as a result of being banned, and the only way I can see to do it to capture and check the error message.