Visual C++ Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Email Object
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

Change Current Remote FTP Directory

C++ sample code to change the current remote directory on an FTP server during an FTP session.

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries
FreeBSD C++ Libraries
HP-UX C++ Libraries
BlackBerry QNX C++ Libraries
void FtpChangeRemoteDir(void)
    {
    CkFtp2 ftp;
    ftp.UnlockComponent("anything for 30-day trial");

    ftp.put_Hostname("ftp.chilkatsoft.com");
    ftp.put_Username("***");
    ftp.put_Password("***");

    // non-passive (active) connections are most likely to work if firewalls are present.
    ftp.put_Passive(false);

    // Connect to the FTP server and login.
    bool success = ftp.Connect();
    if (!success)
	{
	ftp.SaveLastError("ftpLog.txt");
	return;
	}

    // Change to a sub-directory relative to our current remote directory.
    success = ftp.ChangeRemoteDir("download");
    if (!success)
	{
	ftp.SaveLastError("ftpLog.txt");
	return;
	}

    // Change to a directory that is an absolute path from our FTP login's home directory.
    success = ftp.ChangeRemoteDir("/download");
    if (!success)
	{
	ftp.SaveLastError("ftpLog.txt");
	return;
	}

    // Move up one directory relative to our current remote directory.
    success = ftp.ChangeRemoteDir("..");
    if (!success)
	{
	ftp.SaveLastError("ftpLog.txt");
	return;
	}

    // Change the current remote directory to the FTP account's home directory
    success = ftp.ChangeRemoteDir("/");
    if (!success)
	{
	ftp.SaveLastError("ftpLog.txt");
	return;
	}

    // Go two directories down from the current remote directory.
    success = ftp.ChangeRemoteDir("test/images");
    if (!success)
	{
	ftp.SaveLastError("ftpLog.txt");
	return;
	}

    ftp.Disconnect();
    }

 

 

 

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Mail Component · XML Parser