Skip to content

Instantly share code, notes, and snippets.

@BikashMahata
BikashMahata / upload.cs
Created July 22, 2018 16:16 — forked from DavidDeSloovere/upload.cs
SFTP upload with SSH.NET
const string host = "domainna.me";
const string username = "chucknorris";
const string password = "norrischuck";
const string workingdirectory = "/highway/hell";
const string uploadfile = @"c:\yourfilegoeshere.txt";
Console.WriteLine("Creating client and connecting");
using (var client = new SftpClient(host, port, username, password))
{
client.Connect();