Quantcast
Channel: SSH.NET Library
Viewing all 2955 articles
Browse latest View live

Reviewed: 2016.0.0 (Thg6 07, 2017)

$
0
0
Rated 5 Stars (out of 5) - good good good good

Reviewed: 2016.0.0 (Ιουν 08, 2017)

$
0
0
Rated 1 Stars (out of 5) - Download Please

Reviewed: 2016.0.0 (Haz 15, 2017)

$
0
0
Rated 5 Stars (out of 5) - thank you thank you thank you

Reviewed: 2016.0.0 (6 18, 2017)

$
0
0
Rated 5 Stars (out of 5) - very very cool!!!!!

Reviewed: 2016.0.0 (Jun 21, 2017)

$
0
0
Rated 5 Stars (out of 5) - very very cool

New Post: HOW TO: Use SSH.NET in Visual Studio 2008 Professional and .NET Framework 3.5

$
0
0
You should be able to download the source, and build from there - you'll want the Renci.SshNet.NET35 project which will open in VS2008 OK - you will need to make a few minor changes to get it to build, as the source uses default values for some parameters, which VS2008 will sulk about.

New Post: Minimum version required for SHA-256

$
0
0
I have the SSH.NET library 4.0.30319 and I want to make sure this version will support SHA-256, or if there is a newer version I need.

New Post: Minimum version required for SHA-256

$
0
0
Also, if the version we have does support SHA-256 what special settings do we need to have to make it work?

Reviewed: 2016.0.0 (七月 17, 2017)

$
0
0
Rated 5 Stars (out of 5) - very nice!!!!!

New Post: SftpClient connect exception "No existing connection"

$
0
0
Hello

I did a small program, below, that does a SftpClient connect call
When I run the program on
a Windows 10 PC that I have administrator permissions, all works built with Visual Studio 2015

When I run the program on a Windows 7 PC (Visual Studio 2013) that I do not have administrator permissions,
I get an exception after the "connect" call

"no existing connection. Will make new connection to server 127.0.0.1
Exception has been thrown by the target of an invocation"

I am using
SftpClient sftp = new SftpClient("127.0.0.1", username, password);
sftp.Connect();
the differences between the 2 cases seems to be only
1) administrator permissions
2) Windows 10 versus 7
3) Visual Studio 2015 versus 2013


the complete program
namespace SftpServerConnection
{
  class SftpServerConnection
  {
    private string address;
    private string username;
    private string password;
    private string directory;

    ///////////////////////////////////////////////////////////////////////////////////////
    //SftpServerConnection
    ///////////////////////////////////////////////////////////////////////////////////////

    public SftpServerConnection(string address, string username, string password, string directory)
    {
      this.address = address;
      this.username = username;
      this.password = password;
      this.directory = directory;
    }

    ///////////////////////////////////////////////////////////////////////////////////////
    //SftpServerConnection::list
    ///////////////////////////////////////////////////////////////////////////////////////

    public bool list()
    {
      SftpClient sftp = new SftpClient(address, username, password);
      sftp.Connect();
      Console.WriteLine("connected to {0} ...", address);

      var files = sftp.ListDirectory(directory);
      Console.WriteLine("listing directory:");
      foreach (var file in files)
      {
        Console.WriteLine(file.FullName);
      }

      sftp.Disconnect();
      return true;
    }

    ///////////////////////////////////////////////////////////////////////////////////////
    //SftpServerConnection::send
    ///////////////////////////////////////////////////////////////////////////////////////

    public bool send(string fileName)
    {
      SftpClient sftp = new SftpClient(address, username, password);
      sftp.Connect();
      Console.WriteLine("connected to {0} ...", address);

      sftp.ChangeDirectory(directory);
      FileStream fileStream = new FileStream(fileName, FileMode.Open);
      Console.WriteLine("Uploading {0} ({1:N0} bytes)", fileName, fileStream.Length);
      sftp.UploadFile(fileStream, fileName);

      sftp.Disconnect();
      return true;
    }

    ///////////////////////////////////////////////////////////////////////////////////////
    //Main
    ///////////////////////////////////////////////////////////////////////////////////////

    static int Main(string[] args)
    {
      if (args.Length != 2)
      {
        System.Console.WriteLine("Please enter host and password separated by a space...");
        return 1;
      }

      string host = args[0];
      string password = args[1];
      string username = "pvn";
      string directory = ".";
      SftpServerConnection sftp_connection = new SftpServerConnection(
        host,
        username,
        password,
        directory);

      sftp_connection.send("test.txt");
      sftp_connection.list();
      return 0;
    }
  }
}

Reviewed: 2016.0.0 (ago 23, 2017)

$
0
0
Rated 5 Stars (out of 5) - very nice!!

New Post: Missing wiki page: https://github.com/sshnet/SSH.NET/releases/tag/2016.0.0

Reviewed: 2016.0.0 (Aug 28, 2017)

$
0
0
Rated 1 Stars (out of 5) - where is the download link ?

New Post: Error uploading

$
0
0
I am receiving error "The requested operation failed". This code is being successfully used by another development group in our company but I am not able to get it to work. The code is connecting to the ftp site, just can upload.

public static void UploadSFTP(string fullFilePath, string remoteFilePath, string host, int port, string username, string password)
  {
     Logger.LogInfo("Starting UploadSFTP");
     try
     {
        string localDirectoryPath = Path.GetDirectoryName(fullFilePath);
        DirectoryInfo di = new DirectoryInfo(localDirectoryPath);
        // The output directory should already exist.
        if (!Directory.Exists(localDirectoryPath))
        {
           throw new DirectoryNotFoundException(string.Format("  The specified directory does not exist. directory={0}", localDirectoryPath));
        }

        ConnectionInfo connectionInfo = new PasswordConnectionInfo(host, username, password);
        using (SftpClient sftp = new SftpClient(connectionInfo))
        {
           Logger.LogInfo(string.Format("  Connecting via SFTP to host={0}, port={1}", host, port));
           sftp.Connect();
           Logger.LogInfo("  Attempting to upload " + fullFilePath);
           using (Stream reader = File.OpenRead(fullFilePath))
           {
              sftp.UploadFile(reader, Path.Combine(remoteFilePath, Path.GetFileName(fullFilePath)));
           }
           Logger.LogInfo("  Successfully uploaded.");
        }
     }
     catch (Exception ex)
     {
        Logger.LogException(ex);
     }
     Logger.LogInfo("Ending UploadSFTP");
  }

Reviewed: 2016.0.0 (Nov 09, 2017)

$
0
0
Rated 4 Stars (out of 5) - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Viewing all 2955 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>