/// <summary> /// Raises <b>Rnto</b> event. /// </summary> /// <param name="e">Event data.</param> private void OnRnto(FTP_e_Rnto e) { if(this.Rnto != null){ this.Rnto(this,e); } }
private void RNTO(string argsText) { if(m_SessionRejected){ WriteLine("500 Bad sequence of commands: Session rejected."); return; } if(!this.IsAuthenticated){ WriteLine("530 Please authenticate firtst !"); return; } if(string.IsNullOrEmpty(argsText)){ WriteLine("501 Invalid path value."); } if(m_RenameFrom.Length == 0){ WriteLine("503 Bad sequence of commands."); return; } /* This command specifies the new pathname of the file specified in the immediately preceding "rename from" command. Together the two commands cause a file to be renamed. */ FTP_e_Rnto eArgs = new FTP_e_Rnto(m_RenameFrom,argsText); OnRnto(eArgs); // API didn't provide response. if(eArgs.Response == null){ WriteLine("500 Internal server error: FTP server didn't provide response for RNTO command."); } else{ foreach(FTP_t_ReplyLine reply in eArgs.Response){ WriteLine(reply.ToString()); } } }