using (var client = new SftpClient("Host", 22, "UserName", "Password"))
{
client.Connect();
try
{
var data = File.ReadAllBytes("C:\\test.zip")
using (SftpFileStream sw = client.OpenWrite("/home/test.zip"))
{
sw.Write(data, 0, data.Length);
}
}
catch(Exception ex)
{
throw ex;
}
finally
{
client.Disconnect();
}
}