Код: Выделить всё
ConnectionInfo ConnNfo = new ConnectionInfo("127.0.0.1", 22, "usertest",
new AuthenticationMethod[]{
// Pasword based Authentication
new PasswordAuthenticationMethod("usertest","usertest"),
}
);
// Upload A File
using (var sftp = new SftpClient(ConnNfo))
{
sftp.Connect();
sftp.ChangeDirectory(@"/C:/IISFTP/");
using (var uplfileStream = File.OpenRead(uploadfn))
{
sftp.UploadFile(uplfileStream, uploadfn, true);
}
sftp.Disconnect();
}
Сообщение тип 80 недопустим
Почему это происходит? Как я могу подключиться к своему SFTP-серверу с помощью SSH.NET?
Пробовал как последнюю версию SSH.NET из исходного кода, так и пакет NuGet (v2013.4.7 на момент написания)
OpenSSH (я использовал ssh -v localhost):
OpenSSH_7.1p1 Microsoft_Win32_port_with_VS, OpenSSL 1.0.2d 9 июля 2015 г.
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/368 ... -not-valid
Мобильная версия