Click here to Skip to main content
11,925,381 members (58,865 online)
Click here to Skip to main content
Add your own
alternative version


32 bookmarked

An "easy to use" FTP client library

, 10 May 2006
Rate this:
Please Sign up or sign in to vote.
Get connected to your FTP server


The .Net Framework 2.0 has built-in support for accessing FTP server through the FtpWebRequest and FtpWebResponse classes.

This library provides easy access to the most common operations against FTP servers by providing an easy interface against this new features in the .Net 2.0 Framework.

I am sure there is a lot more to FTP than what is covered here, but if your needs are simple, this may be a starting point.

Using the library

Say that you want to upload a file to a remote FTP server.

The following example shows how to use FtpDotNet to accomplish this task.

     FtpConnection connection = new FtpConnection();
     connection.MessageReceived += new FtpConnectionEventHandler(connection_MessageReceived);
     connection.Host = "";
     connection.UserName = "username";
     connection.Password = "password";
     connection.RemoteDirectory = "/MyDirectory";
     connection.Upload(@"C:\Temp\House.jpg", "House.jpg");
 catch (WebException ex)
 catch (Exception ex)


The connection object has an event called Messagereceived where you can retrieve response messages sent from the  FTP server during operations.

<PRE class=code>void connection_MessageReceived(object sender, FtpConnectionEventArgs e)





This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Software Developer
Norway Norway
I'm a 39 year old software developer living in Norway.
I'm currently working for a software company making software for the retail industry.

You may also be interested in...

Comments and Discussions

QuestionHow to Add % complete or Bytes send during the upload? Pin
wozzarvl17-Apr-15 7:40
memberwozzarvl17-Apr-15 7:40 
Question<DIR> is not handled by regular expression Pin
pvolchek20-Jul-11 10:13
memberpvolchek20-Jul-11 10:13 
Generalgood! Pin
yuyejian4-Jun-10 0:00
memberyuyejian4-Jun-10 0:00 
GeneralA comfortable FTP class in .NET Pin
Elmue27-Aug-08 13:40
memberElmue27-Aug-08 13:40 

If you search a comfortable and reusable FTP client,

-- which is running on .NET Framework 1.1 or higher,
-- which can automatically put together splitted files on the server,
-- which allows to download only a part of a file on the server,
-- which allows to resume any broken download,
-- which automatically starts a separate thread,
-- which can be aborted any time from your main thread,
-- which supports UTF8 encoded filenames,
-- which has a built-in download scheduler,
-- which has a built-in bandwidth control,
-- which has a built-in preview function for the download of movies,
-- which automatically reconnects the server after an error has occurred,
-- which displays download progress in percent and in bytes and the remaining time,
-- which writes a detailed logging for all operations it does,
-- which is based on Wininet.dll and has one workaround for each of the 4 known Wininet.dll bugs,
-- which is very well tested and bug-free,
-- which is written by a very experienced programmer and has a very clean and well documented sourcecode,

then have a look at this project:

ElmueSoft Partial FTP Downloader[^]

QuestionLicense Pin
KITTA196424-Mar-08 1:53
memberKITTA196424-Mar-08 1:53 
GeneralRe: License Pin
seesharper1-Apr-08 9:04
memberseesharper1-Apr-08 9:04 
QuestionProxy Pin
tarantula325-Jan-08 13:36
membertarantula325-Jan-08 13:36 
GeneralCreateWebRequest fails Pin
ccengine8-Oct-07 2:23
memberccengine8-Oct-07 2:23 
GeneralThe remote server returned an error: (530) Not logged in Pin
Charles Meyer17-Feb-07 11:00
memberCharles Meyer17-Feb-07 11:00 
GeneralRe: The remote server returned an error: (530) Not logged in Pin
MH253817-Mar-07 1:47
memberMH253817-Mar-07 1:47 
GeneralThank You! Pin
DORMark10-Jan-07 7:45
memberDORMark10-Jan-07 7:45 
QuestionQuestions... [modified] Pin
chris17510-Nov-06 6:28
memberchris17510-Nov-06 6:28 
Generalabout DirectoryList [modified] Pin
Alper Hankendi11-Oct-06 23:44
memberAlper Hankendi11-Oct-06 23:44 
QuestionNice FTP code but need some help. Pin
Adnan Jamil15-Jun-06 9:19
memberAdnan Jamil15-Jun-06 9:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.151126.1 | Last Updated 10 May 2006
Article Copyright 2006 by seesharper
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid