Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

delete file from FTP c#

private string DeleteFile(string fileName)    
{    
   FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://www.server.com/" + fileName);    
   request.Method = WebRequestMethods.Ftp.DeleteFile;    
   request.Credentials = new NetworkCredential("username", "password");    
    
   using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())    
   {    
      return response.StatusDescription;        
   }    
}    
 
PREVIOUS NEXT
Tagged: #delete #file #FTP
ADD COMMENT
Topic
Name
7+3 =