Hello,
You will find following Code Project articles very useful.
Sample code (
Directly taken from MSDN)
using System;
using System.IO;
using System.Net;
using System.Text;
namespace Net.FtpUtil
{
public class FtpHelper
{
public void doUpload(String strData)
{
FtpWebRequest request = (FtpWebRequest) WebRequest.Create("ftp://www.myserver.com");
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential ("anonymous","anonymous@contoso.com");
byte [] fileContents = Encoding.UTF8.GetBytes(strData);
request.ContentLength = fileContents.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
response.Close();
}
}
}
Regards