Return to Snippet

Revision: 41227
at February 14, 2011 19:12 by fady_ay


Initial Code
www.c-sharpcorner.com/uploadfile/danglass/ftpcl...9/23/08
private FtpClient ftp = null;
private void UploadPicture(string imagePath)
{
string FtpServer = ConfigurationSettings.AppSettings["FtpServer"];
string FtpUserName = ConfigurationSettings.AppSettings["FtpUserName"];
string FtpPassword = ConfigurationSettings.AppSettings["FtpPassword"];
AsyncCallback callback = new AsyncCallback(CloseConnection);
ftp = new FtpClient(FtpServer,FtpUserName,FtpPassword);
ftp.Login();
ftp.BeginUpload(imagePath, callback);
ftp.Close();
}
private void CloseConnection(IAsyncResult result)
{
Debug.WriteLine(result.IsCompleted.ToString());
if ( ftp != null ) ftp.Close();
ftp = null;
}

Initial URL
http://www.c-sharpcorner.com/uploadfile/danglass/ftpclient12062005053849am/ftpclient.aspx?articleid=620360d4-ec30-4ab3-a724-369e656d4003&login=true&user=fady_ay

Initial Description

                                

Initial Title
FTP Client for C#

Initial Tags

                                

Initial Language
C#