C# Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

C# Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
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...
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

FTP Upload with Progress Monitoring

Download Chilkat .NET for 4.0 Framework

Download Chilkat .NET for 64-bit 4.0 Framework (x64)

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 64-bit 2.0 / 3.5 Framework (x64)

Download Chilkat .NET for 1.0 / 1.1 Framework

Demonstrates how to upload a file to an FTP server with progress monitoring event callbacks. Also demonstrates how to abort an FTP upload 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 while in progress.
		// This example aborts the FTP transfer after it is 50% complete.
		if (args.PercentDone >= 50)
		{
		    args.Abort = true;
		}
	    }

	    // FTP Put with progress monitoring event callbacks.
	    // Upload a file to an FTP server with percent done callbacks.
	    private void button5_Click(object sender, System.EventArgs e)
	    {
		Chilkat.Ftp2 ftp = new Chilkat.Ftp2();
		ftp.UnlockComponent("Any string unlocks for 30-day trial.");
		
		ftp.Hostname = "ftp.chilkatsoft.com";
		ftp.Username = "***";
		ftp.Password = "***";
		
		ftp.EnableEvents = true;

		// Set the SendBufferSize to a smaller value than the default of 512K to get more frequent callbacks:
		// This may slightly degrade performance.
		ftp.SendBufferSize = 4096;
		
		ftp.OnFtpPercentDone += new Ftp2.FtpPercentDoneEventHandler(OnFtpPercentDone);

		bool success = ftp.Connect();
		if (success)
		{
		    success = ftp.PutFile("uploadTest.txt","uploadTest.txt");
		    if (success)
		    {
			MessageBox.Show("Done!");
		    }
		    else
		    {
			MessageBox.Show(ftp.LastErrorText);
		    }
		}
		else
		{
		    MessageBox.Show(ftp.LastErrorText);
		}
	    }

 

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

Email Component · XML Parser