SFTP SSH.NET DLL而不是SharpSSH

编程入门 行业动态 更新时间:2024-10-28 22:24:26
本文介绍了SFTP SSH.NET DLL而不是SharpSSH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在寻找一个免费的DLL .NET处理SFTP连接。

I was seeking for a free DLL for to handle SFTP connections.

我发现这个项目 SharpSSH ,但它缺乏的文档。

I found out this project SharpSSH, but it lacks of documentation.

我花了很多时间来如何的DLL工程。我创建了一个测试项目,我开始测试不同的功能。有些功能正在如删除文件。

I spent a lot of time to figure how the dll works. I created a test project and I started to test different functions. Some functions are working such as deleting files.

我有PUTFILE()函数和GETFILE一个问题()。

I have a problem with putfile() function and getfile().

下面的例子:

Dim ssh As SFTPUtil ssh = New SFTPUtil("MY SERVER", "MY USER", "MY PW") ssh.GetFile("/home/sftptest/test111.xml", "C:\\text.xml")

请注意,该GETFILE()的参数是:

Note that the getfile() parameters are:

Public Sub GetFile(remotePath As String, localPath As String)

我一步的功能,但我没有得到通过这些参数的正确方法。

I step in the functions, but I didn't get the correct way to pass those parameters.

我真的不知道我是否应该用斜线(/)或反斜杠()。我知道,Linux使用(/)

I dont really know if i should use slashes(/) or backslashes (). I know that Linux uses (/)

我注意到,例如,该C:\已经转变为C:\\。

I noticed for example that the "C:\" has been transformed to "C:\\".

刚刚提及的是,SFTP是在Linux机器上。

Just to mention that the SFTP is on a linux machine.

感谢你。

推荐答案

这是我应该做的(vb code)建立与的这个库( SSHnet ),我做的不可以使用SharpSHH:

Here's What I should have done (vb code) to establish the connection with THIS library (SSHnet), I did not use SharpSHH:

Private Sub ButtonAction_Click(sender As Object, e As System.EventArgs) Handles ButtonAction.Click Dim PasswordConnection = New PasswordAuthenticationMethod("test", "test") Dim KeyboardInteractive = New KeyboardInteractiveAuthenticationMethod("test") Dim ConnectionInfo = New ConnectionInfo("192.168.1.1", 22, "test", PasswordConnection, KeyboardInteractive) AddHandler KeyboardInteractive.AuthenticationPrompt, _ Sub(_sender As Object, _e As Renci.SshNet.Common.AuthenticationPromptEventArgs) For Each prompt In _e.Prompts Debug.Print(prompt.Request) If Not prompt.Request.IndexOf("Password:", StringComparison.InvariantCultureIgnoreCase) = -1 Then prompt.Response = "test" End If Next End Sub sftp = New SftpClient(ConnectionInfo) sftp.Connect() sftp.disconnect() End Sub

更多推荐

SFTP SSH.NET DLL而不是SharpSSH

本文发布于:2023-11-04 06:06:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1557142.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不是   SSH   SFTP   NET   SharpSSH

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!