I have 3 variable
that contains the path of the file, each file is in different folder but the same ftp server:
The first variable
called file1
contain that value /ds/product/Jan/09122016_product.csv
The second variable
called file2
contain that value /ds/subproduct/Jan/09122016_subproduct.csv
The third variable
called file3
contain that value /ds/category/Jan/09122016_category.csv
What i want is to check if the 3 files exists in the ftp in one code.
Actually i can verify only one file in one script task in my case if i want to check the 3 files i need 3 script task but i want to optimize this how can i do that ?
string[] folderArray, fileArray;
ConnectionManager cm = Dts.Connections["FTP"];
FtpClientConnection ftpClient = new FtpClientConnection(cm.AcquireConnection(null));
ftpClient.Connect();
ftpClient.SetWorkingDirectory("/ds/product/Jan/");
ftpClient.GetListing(out folderArray, out fileArray);
foreach (String file in fileArray)
{
if (file.Equals("09122016_product.csv"))
{
}
}