Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

June 1, 2006

C# FTP Upload/Download with Progress Monitoring

This example demonstrates how to add progress monitoring for FTP uploads and downloads using Chilkat FTP-2.

<font face=\"courier\" size=2>
	    public void OnPercentDone(object source, Chilkat.PercentDoneEventArgs args)
	    {
		progressBar1.Value = args.PercentDone;
	    }
	
	    // FTP Get
	    private void button6_Click(object sender, System.EventArgs e)
	    {
		Chilkat.Ftp2 ftp = new Chilkat.Ftp2();
		ftp.UnlockComponent("test");
	
		ftp.Hostname = "ftp.chilkatsoft.com";
		ftp.Username = "****";
		ftp.Password = "****";
	
		ftp.EnableEvents = true;
	
		ftp.OnPercentDone += new Ftp2.PercentDoneEventHandler(OnPercentDone);
	
		bool b = ftp.Connect();
		if (b)
		{
		    ftp.GetFile("ChilkatZipSE.exe","ChilkatZipSE.exe");
		    MessageBox.Show("Done!");
		}
		else
		{
		    MessageBox.Show("Failed to connect");
		}
	    }
	
	    // FTP Put
	    private void button5_Click(object sender, System.EventArgs e)
	    {
		Chilkat.Ftp2 ftp = new Chilkat.Ftp2();
		ftp.UnlockComponent("test");
	
		ftp.Hostname = "ftp.chilkatsoft.com";
		ftp.Username = "****";
		ftp.Password = "****";
	
		ftp.EnableEvents = true;
	
		ftp.OnPercentDone += new Ftp2.PercentDoneEventHandler(OnPercentDone);
	
		bool b = ftp.Connect();
		if (b)
		{
		    ftp.PutFile("uploadTest.txt","uploadTest.txt");
		    MessageBox.Show("Done!");
		}
		else
		{
		    MessageBox.Show("Failed to connect");
		}
	    }
</font>


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.