Ok after spending so much time looking at the password and ssh key I realized that one of the characters in the user name was wrong. :oops: it's working now.
- Stick32
mySess.AddRawConfiguration("LogSensitive", "1")
.
Dim sessOpt As New SessionOptions
With sessOpt
.Protocol = Protocol.Sftp
.HostName = "blah.blah.gov"
.UserName = user
.Password = pass
.PortNumber = 22
.SshHostKeyFingerprint = sshkey
End With
Console.WriteLine("Initializing session...")
Using mySess As Session = New Session
mySess.ExecutablePath = "C:\Program Files (x86)\WinSCP\WinSCP.exe"
mySess.IniFilePath = "C:\temp\Tagdata\WinSCP.ini"
mySess.Open(sessOpt)
Dim transfOpt As New TransferOptions
transfOpt.TransferMode = TransferMode.Binary
Console.WriteLine("Session Initialized. Beginning Download...")
'Dim trnsResult As TransferOperationResult
mySess.GetFiles("/root/production/*", My.Settings.InputFile, False, transfOpt).Check()
Console.WriteLine("Download complete. Closing session...")
End Using