FoxPro Examples

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

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
Socket
Spider
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Amazon S3
DKIM / DomainKey
NTLM
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA
FileAccess
Bzip2
LZW

 

Non-Chilkat Links
Text and String Handling

WSAECONNRESET An existing connection was forcibly closed by the remote host.

Explains the meaning of the "WSAECONNRESET An existing connection was forcibly closed by the remote host." error and demonstrates a way to reproduce it by setting the "No Transfer Timeout" setting on a FileZilla FTP server to a very small value.

Download 32-bit Chilkat FTP2 ActiveX (.msi)

Download All 32-bit Chilkat ActiveX Components (.zip)

Download All 64-bit Chilkat ActiveX Components (.zip)

LOCAL loFtp
LOCAL lnSuccess
LOCAL i
LOCAL lcLocalFilename
LOCAL lcRemoteFilename

loFtp = CreateObject('Chilkat.Ftp2')

*  Any string unlocks the component for the 1st 30-days.
lnSuccess = loFtp.UnlockComponent("Anything for 30-day trial")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loFtp.LastErrorText)
    QUIT
ENDIF

loFtp.Hostname = "192.168.1.108"
loFtp.Username = "myLogin"
loFtp.Password = "myPassword"

*  Connect and login to the FTP server.
lnSuccess = loFtp.Connect()
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loFtp.LastErrorText)
    QUIT
ENDIF

loFtp.Passive = 1

*  In this example, we've set the FileZilla FTP Server's
*  "No Transfer Timeout" to 5 seconds.  This is a setting
*  on the FTP server (not in the Chilkat FTP component).
*  It causes the server to disconnect from the client after
*  5 seconds of no upload or download activity.  As you'll see,
*  sending commands over the control channel, such as
*  NOOP (no-operation) commands will have no effect.
*  It is an upload, download, or directory listing that is required.

*  This code will wait 10 seconds before proceeding with
*  the PutFile.  This should be enough time for the FileZilla
*  server to disconnect.

FOR i = 0 TO 10
    *  Sleep for 1 second
    loFtp.SleepMs(1000)

    *  Send a NOOP command to the FTP server.
    *  After about 5 iterations, it should fail and the LastErrorText
    *  will contain this message:
    *  WSAECONNRESET An existing connection was forcibly closed by the remote host.
    lnSuccess = loFtp.Noop()
    IF (lnSuccess <> 1) THEN
        ? loFtp.LastErrorText
        EXIT
    ENDIF

NEXT

*  What happens if we try to upload a file without an existing
*  connection?
*  Let's do it and find out...

*  Upload a file.

lcLocalFilename = "c:/temp/hamlet.xml"

lcRemoteFilename = "hamlet.xml"

lnSuccess = loFtp.PutFile(lcLocalFilename,lcRemoteFilename)
IF (lnSuccess <> 1) THEN

    *  In Active mode (i.e. non-passive), we get this error:
    *  "Failed to get socket's IP address. Socket may already be disconnected."
    *  In Passive mode, we'll get this error:
    *  " No socket exists for sending (2)"
    ? loFtp.LastErrorText
    QUIT
ENDIF

loFtp.Disconnect()

=MESSAGEBOX("File Uploaded!")

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

Mail Component · .NET Email Component · ASP Mail Component · XML Parser