I have two methods, one sends a file via FTP and the other one consumes a file via FTP.
The files have the dynamic name DateTime.Now
each day a new file.
example: coletas-04-04-2017 16_00_19.xlsx
In the Send method I get the current date and give a getFile (); this will always return 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 File consumption method, I would like to do the same thing as the FileInfo[] arquivoData = objDiretorio.GetFiles("Coleta_" + DataAtual + "*.csv"); faz, só que no Diretório FTP
This is the line I use the file, but here I already have to pass the full name,
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(pathFull);
So it's impossible to get only the date '