2
I have two methods, one sends a file by FTP and the other consumes a file by FTP.
The files have the dynamic name DateTime.Now
each day a new file.
example: collections-04-04-2017 16_00_19.xlsx
In the Send method I take the current date and give a getFile(); this always returns the file of the day, regardless of the time.
string DataAtual = DateTime.Now.ToString("yyyyMMdd");
//pathArquivoConsumido = local onde o arquivo esta que sera enviado;
DirectoryInfo objDiretorio = new DirectoryInfo(pathArquivoConsumido);
FileInfo[] arquivoData = objDiretorio.GetFiles("Coleta_" + DataAtual + "*.csv");
Now in the Archives consumption method, I would like to do the same thing as the line FileInfo[] arquivoData = objDiretorio.GetFiles("Coleta_" + DataAtual + "*.csv"); faz, só que no Diretório FTP
This is the line that I consume the file, but here I have to pass the full name,
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(pathFull);
so it is impossible to take only by date`