Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Connection a un SFTP

I believe the message is pretty clear.
Use the same version of WinSCPnet.dll and WinSCP.exe.
Ideally, do not rely on the installed version of WinSCP. Deploy a compatible copy of WinSCP.exe to the same folder, where you deploy the WinSCPnet.dll.
thierry.bertholom

Connection a un SFTP

Bonjour
Je découvre votre application.

J'essaye de l'intégrer à un développement sous VB.NET en utilisant vos exemple de connexions.
Protected Sub WinScpSFTPupload(ByVal fileToBeUploaded As String, uploadedFilename As String)
    Try
        Dim sessionOptions As New SessionOptions
        With sessionOptions
            .Protocol = Protocol.Sftp
            .HostName = C_Parametre.AdresseIPSSH
            .PortNumber = C_Parametre.PortSSH
            .UserName = C_Parametre.UtilisateurSSH
            .SshPrivateKey = "D:\CLIENTS\2024\ADSL\PrivateKeyAgicap.ppk" 'C_Parametre.ClePriveSSH
        End With
        Using session As New Session
            session.Open(sessionOptions)
            session.PutFiles(fileToBeUploaded, uploadedFilename).Check()
        End Using
    Catch ex As Exception
        MsgBox(ex.Message & Chr(13) & Chr(10) & uploadedFilename)
    End Try
End Sub ' Sub to WinSCP SFTP File

voici le message d'erreur

Merci de votre réponse
Thierry.bertholom