using System.Net;
using System.IO;
....
private static void uploadFile(string source)
{
try
{
string filename = Path.GetFileName(source);
string ftpfullpath = "ftp://www.url.com/www/" + filename;
FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(ftpfullpath);
ftp.Credentials = new NetworkCredential("ftp_user_name", "ftp_password");
ftp.KeepAlive = true;
ftp.UseBinary = true;
ftp.Method = WebRequestMethods.Ftp.UploadFile;
FileStream fs = File.OpenRead(source);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();
Stream ftpstream = ftp.GetRequestStream();
ftpstream.Write(buffer, 0, buffer.Length);
ftpstream.Close();
}
catch (Exception ex)
{
MessageBox.Show("Hata: " + ex.Message.ToString());
// throw ex;
}
}