You can use GetFileInfos()
Okay so if I do this:
// First check to see if the top level directory we need already exists,
FTPFile[] ftpFile = ftpConnection.GetFileInfos(strServerDirectory + "/" + strBatchDestDir.Substring(0, 8 ));
// If it does not exist then create a new directory here
if (ftpFile.Count() <= 0)
ftpConnection.CreateDirectory(strServerDirectory + "/" + strBatchDestDir.Substring(0, 8 ));
I can check the file count to make sure that no files exists but if I'm just testing for an 'empty' directory this logic fails. I create the directory with no files. If I do the code above again I still have a count of zero . When I try to create the same directory, a second time, it falls into the try catch. I'm trying to just test for an empty directory without getting an exception. Anything else I can do?
thanks a lot.