Exemple #1
0
		private void DELE(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 file name.");
            }

			/*
				This command causes the file specified in the pathname to be
				deleted at the server site.  If an extra level of protection
				is desired (such as the query, "Do you really wish to
				delete?"), it should be provided by the user-FTP process.
			*/

            FTP_e_Dele eArgs = new FTP_e_Dele(argsText);
            OnDele(eArgs);

            // API didn't provide response.
            if(eArgs.Response == null){
                WriteLine("500 Internal server error: FTP server didn't provide response for DELE command.");
            }
            else{
                foreach(FTP_t_ReplyLine reply in eArgs.Response){
                    WriteLine(reply.ToString());
                }
            }
		}
Exemple #2
0
 /// <summary>
 /// Raises <b>Dele</b> event.
 /// </summary>
 /// <param name="e">Event data.</param>
 private void OnDele(FTP_e_Dele e)
 {
     if(this.Dele != null){
         this.Dele(this,e);
     }
 }