Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.4k views
in .NET FTP by (120 points)
I have the following code. Im trying to set a "prompt" and "response" to a ssh server login using a vb.net application, but when I try and assign the SecureFTPConnection.KBIPromts =Ssh.SSHAuthPrompt as illistrated below as " loSFTP.KBIPrompts = loPrompt" I get an error "Value of type 'EnterpriseDT.Net.FTP.SSH.SSHAuthPrompt' cannot be converted to '1-dimensional array of EnterpriseDT.Net.FTP.SSH.SSHAuthPrompt'."

Im not sure how to get the prompts to work under vb.net, please help

Dim loSFTP As New SecureFTPConnection
loSFTP.LicenseOwner = "A*******"
loSFTP.LicenseKey = "*********"
loSFTP.ServerAddress = "test..com"
loSFTP.ServerPort = 22
loSFTP.UserName = "test"
loSFTP.Password = "test"
loSFTP.Protocol = FileTransferProtocol.SFTP
loSFTP.ServerValidation = SecureFTPServerValidationType.None
loSFTP.AuthenticationMethod = EnterpriseDT.Net.Ssh.AuthenticationType.KeyboardInteractive
Dim loPrompt As New Ssh.SSHAuthPrompt("test", "n")

loSFTP.KBIPrompts = loPrompt

1 Answer

0 votes
by (162k points)
Try something like this:

Dim prompts As SSHAuthPrompt() = {New SSHPasswordPrompt(password)}
ftpConnection.KBIPrompts = prompts
ftpConnection.AuthenticationMethod = AuthenticationType.KeyboardInteractive

Categories

...