C# Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C# Examples

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


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

FTP Download with Progress Monitoring

Download: Chilkat .NET Assemblies

Demonstrates how to download a file from an FTP server with progress monitoring event callbacks. Also demonstrates how to abort an FTP download while in progress.

	    // Progress monitor callback -- called each time the percentage completion
	    // updates to a larger value.
	    public void OnFtpPercentDone(object source, Chilkat.FtpPercentDoneEventArgs args)
	    {
		// args.PercentDone is an integer value between 1 and 100.
		progressBar1.Value = args.PercentDone;
		
		// args.Abort can be set to True to abort the FTP trabsfer while in progress.
		// This example aborts the FTP transfer after it is 60% complete.
		if (args.PercentDone >= 60)
		{
		    args.Abort = true;
		}
	    }

	    // FTP Get with progress monitoring
	    // Demonstrates how to download a file from an FTP server with percentage completion event callbacks.
	    private void button6_Click(object sender, System.EventArgs e)
	    {
		Chilkat.Ftp2 ftp = new Chilkat.Ftp2();
		ftp.UnlockComponent("Any string works for 30-day trial");
		
		ftp.Hostname = "ftp.chilkatsoft.com";
		ftp.Username = "****";
		ftp.Password = "****";
		
		ftp.EnableEvents = true;

		// Some FTP server may require that the AutoGetSizeForProgress property be set to true.
		// Only do this if you see that percent-done progress events are not firing.  
		ftp.AutoGetSizeForProgress = true;
		
		ftp.OnFtpPercentDone += new Ftp2.FtpPercentDoneEventHandler(OnFtpPercentDone);

		// Connect and login.
		bool success = ftp.Connect();
		if (success)
		{
		    // Download a file
		    success = ftp.GetFile("ChilkatZipSE.exe","ChilkatZipSE.exe");
		    if (success)
		    {
			MessageBox.Show("Done!");
		    }
		    else
		    {
			MessageBox.Show(ftp.LastErrorText);
		    }
		}
		else
		{
		    MessageBox.Show(ftp.LastErrorText);
		}
	    }

 

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