Introduction
This article will enable you to write FTP operation in just 5 minutes...
We know that FTP same as direcotry structure which we have on our system, but the difference is that FTP directory is located at some other place.
So when you upload afile you are transfering one file from one place to another, just like in Unix programming, if we want to copy one file from one place to another we
Background
for more Information about Class used in this article Please refer MSDN...
Using the code
you just have to copy and paste this code into your code and that will able to upload or download files from the FTP specified by you...
:
string ftpFilename = ftpServer + FileName;
WebClient client = new WebClient();
client.Credentials = new NetworkCredential(loginName, ftpPwd);
this method will return response from the FTP server which you can use as,
result of FTP operation..
responseArray = client.UploadFile(ftpFilename, filetobeUploaded);
ftpFilename, like if you want to upload file to ftp:
use this kind of structure..
ftpFilename = "ftp://simpleftp.com/test.txt";
Webclient class Object.
Points of Interest
I like to Share my knowledge with guys like you, because i am also one of you, that if i dont know anything then i come to you...so keep exchange of knowledge...
History
If i find any shorter method of FTP then defenetly i will add that in this article...