private void CWD(string argsText) { if(m_SessionRejected){ WriteLine("500 Bad sequence of commands: Session rejected."); return; } if(!this.IsAuthenticated){ WriteLine("530 Please authenticate firtst !"); return; } /* This command allows the user to work with a different directory or dataset for file storage or retrieval without altering his login or accounting information. Transfer parameters are similarly unchanged. The argument is a pathname specifying a directory or other system dependent file group designator. */ FTP_e_Cwd eArgs = new FTP_e_Cwd(argsText); OnCwd(eArgs); // API didn't provide response. if(eArgs.Response == null){ WriteLine("500 Internal server error: FTP server didn't provide response for CWD command."); } else{ foreach(FTP_t_ReplyLine reply in eArgs.Response){ WriteLine(reply.ToString()); } } }
/// <summary> /// Raises <b>Cwd</b> event. /// </summary> /// <param name="e">Event data.</param> private void OnCwd(FTP_e_Cwd e) { if(this.Cwd != null){ this.Cwd(this,e); } }