Problem:
How can you interact with a FTP Server from COBOL on .Net ?
Resolution:
The .Net framework V2 introduced some new classes that allow developers to easily use FTP programmatically.
The FTP classes are located in the System.Net namespace. There are 2 main classes involved. You need to create an instance of FtpWebRequest containing the details of the FTP request you need to perform.
You then need to use the FtpWebResponse class to receive the file you are attempting to receive.
If you are accessing an FTP server that requires logon then you can specify login details using the System.Net.NetworkCredentials. An instance of this is returned from the FtpWebRequest "Credentials" property.
Attached to this article is an example showing how to use these FTP classes from COBOL.
You will require Net Express V5 and Visual Studio 2005 in order to this example.
The demo is attached.