I am trying to convert a C# sample (ftp from AlexPilotti) to AcuCobol, but the second part is not clear to me.
Maybe someone can help me with this sample.
https://archive.codeplex.com/?p=ftps
using AlexPilotti.FTPS.Client;
using AlexPilotti.FTPS.Common;
using System.Net;
class Test
{
public static void Main()
{
using (FTPSClient client = new FTPSClient())
{
// Connect to the server, with mandatory SSL/TLS
// encryption during authentication and
// optional encryption on the data channel
// (directory lists, file transfers)
client.Connect("ftp.yourserver.com",
new NetworkCredential("yourUsername",
"yourPassword"),
ESSLSupportMode.CredentialsRequired |
ESSLSupportMode.DataChannelRequested);
// Download a file
client.GetFile("/path/to/remotefile.jpg", "c:\\\\local\\\\path\\\\");
}
}
}
Part of NETDEFGEN
* FULLY-QUALIFIED-NAME AlexPilotti.FTPS.Client.FTPSClient, AlexPilotti.FTPS.Client, Version=1.1.0.27735, Culture=neutral, PublicKeyToken=48316da1e84b328d
* AlexPilotti.FTPS.Client.FTPSClient
NAMESPACE "AlexPilotti.FTPS.Client"
CLASS "FTPSClient"
MODULE "AlexPilotti.FTPS.Client.dll"
CONSTRUCTOR, 0, @CONSTRUCTOR1
* [Class: FTPSClient] System.String Connect(System.String)
METHOD, 0, "@Connect"
"BSTR" @hostname, TYPE 8
RETURNING "BSTR", TYPE 8
* [Class: FTPSClient] System.String Connect(System.String, AlexPilotti.FTPS.Client.ESSLSupportMode)
METHOD, 0, "@Connect"
"BSTR" @hostname, TYPE 8
"int" @sslSupportMode, TYPE 3
RETURNING "BSTR", TYPE 8
AcuCobol source
IDENTIFICATION DIVISION.
PROGRAM-ID. SFTP.
AUTHOR. EB.
DATE-WRITTEN. 01/01/21.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. RMC.
OBJECT-COMPUTER. RMC.
special-names.
COPY "D:\\FTPS\\AlexPilotti.FTPS.Client.DEF"..
DATA DIVISION.
WORKING-STORAGE SECTION.
copy "P:\\AcuCorp\\AcuGT\\sample\\def\\acucobol.def".
copy "P:\\AcuCorp\\AcuGT\\sample\\def\\acugui.def".
copy "P:\\AcuCorp\\AcuGT\\sample\\def\\crtvars.def".
copy "P:\\AcuCorp\\AcuGT\\sample\\def\\controls.def".
copy "P:\\AcuCorp\\AcuGT\\sample\\def\\opensave.def".
77 WS-STATUS PIC 9(04) VALUE 0.
77 WS-STRING PIC X(256) VALUE SPACES.
77 MY-ASSY-HANDLE USAGE IS HANDLE.
77 MY-ASSY-HANDLE-FTPSClient USAGE IS HANDLE.
*----------------------------------------------------------------
PROCEDURE DIVISION.
MAIN-PROG SECTION.
INIT-PARAM.
CREATE "AlexPilotti.FTPS.Client"
NAMESPACE IS "AlexPilotti.FTPS.Client",
CLASS-NAME IS "FTPSClient",
CONSTRUCTOR IS CONSTRUCTOR1(),
HANDLE IS MY-ASSY-HANDLE.
Can someone help met with the connect statement.
I have to translate ... using (FTPSClient client = new FTPSClient())
But it is not clear for me how.
From here (connect) Undefined data item: FTPSCLIENT
MODIFY MY-ASSY-HANDLE
("ftp.server.com",
"ftp_login_naam",
"password"
) GIVING WS-STRING.
And how to convert the download
// Download a file
client.GetFile("/path/to/remotefile.jpg", "c:\\\\local\\\\path\\\\");
ENDS.
stop run.