Re: count files without hidden files
var nonHiddenFiles = allFiles.Where(_ => !_.Name.StartsWith('.'));
nbrFilesInFTP = nonHiddenFiles.Count();
(untested)
var nonHiddenFiles = allFiles.Where(_ => !_.Name.StartsWith('.'));
nbrFilesInFTP = nonHiddenFiles.Count();
var allFiles = session.EnumerateRemoteFiles(dossierDepot.FullName, null, EnumerationOptions.AllDirectories);
nbrFilesInFTP = allFiles.Count();