private IList<string> getAllFilePaths(string remotePath, string regExpresion) { var fileList = new List<string>(); _logger.DebugFormat("_ftpInfo.Address: {0}", _ftpInfo.Address); _logger.DebugFormat(" _ftpInfo.UserName: {0}", _ftpInfo.UserName); _logger.DebugFormat("_ftpInfo.PassWord: {0}", _ftpInfo.PassWord); _logger.DebugFormat("RemotePath: {0}", remotePath); var client = new FtpClient(new FtpInfo(_ftpInfo.Address, _ftpInfo.UserName, _ftpInfo.PassWord)); fileList= client.GetAllFtpFiles(remotePath, regExpresion).ToList(); //new SftpClient(getHost(_ftpInfo.Address), 22, _ftpInfo.UserName, _ftpInfo.PassWord); //client.Connect(); //fileList = client.ListDirectory(remotePath).Select(x => x.FullName).ToList(); //client.Disconnect(); return fileList; }