Simple way to FTP a file...

You can use the WebClient class to FTP a file...and it's super simple.

WebClient wc = new WebClient();
wc.Credentials = new NetworkCredential(ftpUserName, ftpPassword);
wc.UploadFile(ftp://url.com/somefile.txt, @"C:\somefile.txt" );

There are also a number of overloads for the UploadFile() method. Check 'em out...it's pretty useful.

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.