script task to find if file exisits on a FTP site and then if it exists run the rest of the package

Hi experts,
I have found the attached code which sets the the 'Fileexists' user variable to true if a specified file exists on the FTP site, I understand that the I have to create a user variable Fileexists and then use it as a write variable in the script task , but I am new to c# coding, do would really help if you can look at the code and provide any corrections. I understand that I have to give the ftp credentials, folder name and file name in the C# code but I am not aware of the rest of the syntax.
Please help. For ex: the ftp site =, username: user1, pwd: 123, the folder path:
Thanks script-task.txt script-task.txt
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David ToddSenior DBACommented:

What I did recently was to get all available files from ftps site using a 3rd party component, then in my directory process available files. Once processed, move files to processed subdirectory, and delete from ftps site.

If there are no local files then those steps - as I'm using a for each file iterator - will be skipped


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sqlcuriousAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.