Ftp transfer

Discussion about Code Builder Builder and Winlog language support.
user1

Ftp transfer

Postby user1 » Tue Mar 09, 2010 10:21 am

I had two PCs.
One PC have winlog and visualbasic program.
Visual basic program create daily excel sheet.
The other PC have winlog only.
I need to transfer the daily excel sheet from the first PC to the second one using winlog FTP.
Please, tell us if it is possible (example for doing that).

Lorenzo
Posts: 11
Joined: Tue Nov 17, 2009 3:52 pm

Re: Ftp transfer

Postby Lorenzo » Tue Mar 09, 2010 2:58 pm

Here it is a sample code to tranfer a file via FTP with Winlog Code:

Function bool SendFTPFile()
//********************************************************************

string SourceFullPathFileName;
string DestFullPathFileName;
string FTPHost;
int Handle;


//**********************************
// Send a file in FTP mode.
//**********************************
FTPHost="1.2.3.4";
Handle=FTPConnect(21, // Gate for FTP file transfer
FTPHost, // Host
"SUserName", // Username to access FTP area
"Password", // Password to access FTP area
true, // Passive mode
10000); // Timeout
if (Handle>=0) then
DestFullPathFileName="/ftpGateway/MyFile.txt";
SourceFullPathFileName="C:\MyFile.txt";
FTPPut(Handle,SourceFullPathFileName,DestFullPathFileName ,1);
end
FTPDisconnect(Handle);
end

You can download application here:
viewtopic.php?f=20&t=73


Return to “Code - Code Builder”

Who is online

Users browsing this forum: No registered users and 1 guest