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: [VB6] Connect By ID and PPK file

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
mybaek

[VB6] Connect By ID and PPK file

Hello :)
Thank you for for your precious time.

I have a SFTP Connection ID and .ppk File for SFTP Connect (exclude Password).
And I want to make VB6 code for Connect and Upload file by ID and .ppk file(ppk file path)

I find example about SFTP Connect and apply then, But It doesn't work.

Here's the VB code that I need help.

' Connection Option

    Dim session
    Dim sessionOptions
   
    Set session = New session
    Set sessionOptions = CreateObject("WinSCP.SessionOptions")
   
    Dim myTransferOptions As New TransferOptions
   
     With sessionOptions
        .Protocol = Protocol_Sftp
        .HostName = "SFTP Address"
        .UserName = "SFTP Connect ID"
        .SshPrivateKeyPath = "Full Path of .ppk File"
    End With
   
    ' Binary Mode
    myTransferOptions.TransferMode = TransferMode_Binary
       
   ' Connect
    session.DisableVersionCheck = True
    session.Open (sessionOptions)



I am looking forward to your reply.

Sincerely.