martin wrote:
Swindellvc@cofc.edu wrote:
Where are the session logs?
To generate the session log file with .NET assembly, set
Session.SessionLogPath
.
When I added this...I got a different error "Error: Error occurred during logging. It's been turned off."
This is what was added
Dim mySession As New Session
With mySession
.SessionLogPath = "C:\Development\LOGS\"
End With
Upload(mySession) <- This is the code I sent
Private Sub Upload(ByRef mySession As Session)
' Setup session options
Dim sMsg As String = vbNull
Dim mySessionOptions As New WinSCP.SessionOptions
mySession.DisableVersionCheck = True
With mySessionOptions
.Protocol = Protocol.Sftp
.PortNumber = 22
.HostName = "REMOVED"
.SshPrivateKeyPassphrase = "REMOVED"
.UserName = "cofc"
.SshHostKeyFingerprint = "REMOVED"
'.SshPrivateKeyPath = "\\aiken\ProdCognos\ITExtracts\SSHKEY\myKey.ppk"
.SshPrivateKeyPath = "M:\ITExtracts\SSHKEY\myKey.ppk"
End With
' Connect
mySession.Open(mySessionOptions)
' Upload files
Dim MyTransferOptions As New WinSCP.TransferOptions
myTransferOptions.TransferMode = TransferMode.Binary
Dim transferResult As TransferOperationResult
'transferResult = mySession.PutFiles("\\aiken\ProdCognos\ITExtracts\studentlist.csv", "/studentlists/", False, myTransferOptions)
transferResult = mySession.PutFiles("M:\ITExtracts\studentlist*", "/studentlists/*.*", False, MyTransferOptions)
' Throw on any error
transferResult.Check()
' Display results
Dim transfer As TransferEventArgs
For Each transfer In transferResult.Transfers
sMsg = "Upload of " & transfer.FileName & " succeeded"
MsgBox(sMsg, MsgBoxStyle.Information)
Next
End Sub
Description: Error