FRBDK/ExecutableRunner/BuildServerUploader/BuildServerUploaderConsole/Processes/UploadFilesToFrbServer.cs
/// <summary>
/// method to delete folder on the FTP server
/// Note: the directory should be empty.
/// </summary>
/// <param name="strFtpPath">FTP server path i.e: ftp://yourserver/foldername</param>
/// <param name="strftpUserId">username</param>
/// <param name="strftpPassword">password</param>
method to delete folder on the FTP server
Note: the directory should be empty.
method to delete folder on the FTP server Note : the directory should be empty .
public void DeleteFtpDirectory(string strFtpPath, string strftpUserId, string strftpPassword)
        {
            var reqFtp = (FtpWebRequest)WebRequest.Create(new Uri(strFtpPath));
            reqFtp.Method = WebRequestMethods.Ftp.RemoveDirectory;
            reqFtp.UseBinary = true;
            reqFtp.Credentials = new NetworkCredential(strftpUserId, strftpPassword);
            var response = (FtpWebResponse)reqFtp.GetResponse();
            Stream ftpStream = response.GetResponseStream();
            if (ftpStream != null) ftpStream.Close();
            response.Close();
        }
public void DeleteFtpDirectory ( string strFtpPath , string strftpUserId , string strftpPassword ) { var reqFtp = ( FtpWebRequest ) WebRequest . Create ( new Uri ( strFtpPath ) ) ; reqFtp . Method = WebRequestMethods . Ftp . RemoveDirectory ; reqFtp . UseBinary = true ; reqFtp . Credentials = new NetworkCredential ( strftpUserId , strftpPassword ) ; var response = ( FtpWebResponse ) reqFtp . GetResponse ( ) ; Stream ftpStream = response . GetResponseStream ( ) ; if ( ftpStream != null ) ftpStream . Close ( ) ; response . Close ( ) ; }
method to delete folder on the FTP server
Note: the directory should be empty.
method to delete folder on the FTP server Note : the directory should be empty .
// dirName = name of the directory to create.
strFtpPath
string
None
strftpUserId
string
None
strftpPassword
string
None