Hello all,
I find this code in the FtpConnection.Login() method:
public virtual void Login(string user, string password)
{
CheckConnection(true);
FTPReply reply = control.SendCommand("USER " + user);
// we allow for a site with no password - 230 response
string[] validCodes = new string[]{"230", "331"};
lastValidReply = control.ValidateReply(reply, validCodes);
if (lastValidReply.ReplyCode.Equals("230"))
return ;
else
{
Password(password);
}
}
Strictly, this code is incorrect. If there is no password set on the server, but a (obviously incorrect) password is provided to this method, it will login anyway. Better code would in my opinion be:
if (lastValidReply.ReplyCode.Equals("230") && (password == null || password.Length < 1))
Keep up the good work.
Kind regards,
Davidvl