Skip to content

Instantly share code, notes, and snippets.

@FernandoVezzali
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FernandoVezzali/9687695 to your computer and use it in GitHub Desktop.
Save FernandoVezzali/9687695 to your computer and use it in GitHub Desktop.
FTP
// first install this NuGet package: Install-Package ftplib
static void Main(string[] args)
{
using (var tConn = new FtpConnection("00.000.00.000", "UserName", "Password"))
{
tConn.Open();
tConn.Login();
if (tConn.DirectoryExists("/www"))
tConn.SetCurrentDirectory("/www");
try
{
tConn.PutFile(@"C:\index.htm");
}
catch (FtpException e)
{
// Handle exception
}
tConn.Close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment