Hi all,
I'm using WinScp.dll (WinScp .NET Assembly, http://winscp.net/eng/docs/library_install) in my project to upload a file, it's working, but I'm still getting error:
Conversion from string "source file" to type iInteger' isn't valid.
How could I fix it ? Thank You
Code:
I'm using WinScp.dll (WinScp .NET Assembly, http://winscp.net/eng/docs/library_install) in my project to upload a file, it's working, but I'm still getting error:
Conversion from string "source file" to type iInteger' isn't valid.
How could I fix it ? Thank You
Code:
PHP Code:
Try
Dim sessionOptions As New SessionOptions
With sessionOptions
.Protocol = Protocol.Sftp
.HostName = "my_server"
.UserName = "my_user"
.Password = "my_passwd"
.PortNumber = "2222"
.SshHostKeyFingerprint = "ssh-rsa 2048 e1:52:3b:2d:a1:e1:22:f4:cf:06:ef:6c:4a:82:e1:9a"
End With
Using session As Session = New Session
session.Open(sessionOptions)
session.DebugLogPath = "WinScp.log"
Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Binary
Dim transferResult As TransferOperationResult
transferResult = session.PutFiles("C:\my_file.exe", "/MY_REM_DIR/", False, transferOptions)
transferResult.Check()
Dim transfer As TransferEventArgs
For Each transfer In transferResult.Transfers
MsgBox("Upload of {0} succeeded", transfer.FileName)
Next
End Using
Catch ex As Exception
MsgBox("Error: " & ex.Message)
End Try