Contact SFTP Server

I wrote a service for our client, which automatically transfers files to specified destinations using FTP. For historical reasons, I use WinInet to do FTP. Everything works fine, but now the client wants to add one destination that accepts only SFTP connections.

I don’t really like the idea of ​​implementing this from scratch, so is there a way to communicate natively or through WinInet using an SFTP server? Are there any system libraries that I can use (I'm not afraid of P / Invoke :))? Should I buy third-party components for this - if so, which ones would you suggest?

+5
source share
8 answers

, SFTP WinInet Windows.

/n Software IP * SSH .NET SFTP-.

+2

SFTP .NET framework .


SFTP .

WinSCP.NET. WinSCP NuGet.

# SFTP:

// Setup session options
SessionOptions sessionOptions = new SessionOptions
{
    Protocol = Protocol.Sftp,
    HostName = "example.com",
    UserName = "user",
    Password = "mypassword",
    SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
};

using (Session session = new Session())
{
    // Connect
    session.Open(sessionOptions);

    // Upload files
    session.PutFiles(@"d:\toupload\*", "/home/user/").Check();
}

.


WinSCP GUI SFTP-, , , #, VB.NET PowerShell.

enter image description here


- WinSCP, .NET-. , .NET framework. , -.

.NET SFTP . SSH.NET, .

( WinSCP)

+3

.NET Framwork FTP FtpWebRequest 2.0. SFTP.

FTP SFTP, . SFTP Tamir Gal, . SFTP-, Rebex SFTP.

SFTP:

// create client, connect and log in 
Sftp client = new Sftp();
client.Connect(hostname);
client.Login(username, password);

// upload the content of 'c:\data' directory and all subdirectories 
// to the '/wwwroot' directory at the server 
client.PutFiles(@"c:\data\*", "/wwwroot", SftpBatchTransferOptions.Recursive);

client.Disconnect();

, FTPS SFTP, Rebex File Transfer Pack, . API FTP SFTP.

0

JFYI: , SFTP .NET SFTPBlackbox.

0

SFTP- WinSCP.

, , SFTP- WinSCP.NET.

: https://github.com/ducfilan/SFTP-with-WinSCP

0

sftp, # , , , ​​ SharpSSH

-1

All Articles