MyGit

2016.1.0

sshnet/SSH.NET

版本发布时间: 2017-10-17 02:55:44

sshnet/SSH.NET最新发布版本:2024.1.0(2024-06-28 15:06:08)

Changes

Distribution

The NuGet Package Manager in Visual Studio 2012 does not support packages in which a given dependency is defined for more than one TFM. Since a fix for this issue is not expected any time soon, we're reviving support for a binary distribution.

This plain .zip file contains the SSH.NET assembly, and where applicable any dependencies, for all supported target frameworks.

For Visual Studio 2015 and higher, the SSH.NET NuGet package remains our primary distribution mechanism.

General

ScpClient

A RemotePathTransformation property has been added to ScpClient that can be used to change if and how a remote path is transformed before it is passed to the scp command on the remote server.

SSH.NET comes with the following path transformations that are exposed through the RemotePathTransformation class (in Renci.SshNet):

When none of the built-in transformations match the specific requirements of a remote host, a custom transformation can be supplied.

More information on this change is available here.

Fixes issues #256 and #108.

Example:

Download a file using SCP, and apply shell quoting to the remote path:

using Renci.SshNet;

public class Program
{
  static void Main()
  {
      using (var client = new ScpClient("HOST", 22, "USER", "PWD"))
      {
          client.RemotePathTransformation = RemotePathTransformation.ShellQuote;
          client.Connect();

          using (var ms = new MemoryStream())
          {
              client.Download("/home/sshnet/file 123", ms);
          }
      }
  }
}

Since we've configured ScpClient to use the ShellQuote transformation, the /home/sshnet/file 123 path will automatically be enclosed in single quotes.

The actual path that is passed to the scp command on the remote host is therefore '/home/sshnet/file 123'.

SftpClient

SshClient

Breaking changes

ScpClient

The Upload(FileInfo fileInfo, String path) method in ScpClient now expects path to be the remote path of the file to which you want to upload, and throws a ScpException if a directory exists on the remote host for that path (issue #286).

Up until now, uploading a file with a given (remote) path could lead a different result depending on whether a directory for that path exits on the remote host.

Example:

  using (var client = new ScpClient("host", "user", "pwd"))
  {
      client.Connect();

      client.Upload(new FileInfo(@"c:\temp\newlog.txt", "/home/sshnet/log");
  }

As of version 2016.1.0-beta 3 a ScpException will be thrown when /home/sshnet/log exists as a directory on the remote host.

In previous versions of SSH.NET this code would actually upload the content of the c:\temp\newlog.txt file to /home/sshnet/log/newlog.txt.

When /home/sshnet/log exists on the remote host as a file or does not exist at all, the content of the c:\temp\newlog.txt file will be uploaded to /home/sshnet/log. This has not changed.

SftpClient

Fixes

General

ScpClient

SftpClient

SshClient

ScpClient

Release notes

These release notes include all changes since 2016.0.0. The individual release notes for the releases leading up to the 2016.1.0 release are available here: beta 1, beta 2, beta 3, beta 4.

There have been no changes since beta 4.

相关地址:原始地址 下载(tar) 下载(zip)

1、 SSH.NET-2016.1.0-bin.zip 2.12MB

2、 SSH.NET-2016.1.0-help.chm 2.22MB

查看:2017-10-17发行的版本