Re: Needing help scripting an auto download from a SFTP in C#
It has it uploading files while I'm needing the opposite. Would I need to change "transferResult = session.PutFiles" to "transferResult = session.GetFiles" ?
Correct, use
Session.GetFiles
:
https://winscp.net/eng/docs/library_session_getfiles
Also with the SshHostKeyFingerprint since I do not have the fingerprint is there a way I just bypass that? I saw in another forum post how you were able to bypass it using powershell.
You need to have the fingerprint.
See https://winscp.net/eng/docs/faq_hostkey
And also how do I add a specialized port number to be able to connect to the SFTP?
Use
SessionOptions.PortNumber
:
https://winscp.net/eng/docs/library_sessionoptions
Also how would I go about scheduling a time to run say a nightly download? Is that a Windows Scheduler thing that I would have to set up in windows?
Yes. For scheduling see:
https://winscp.net/eng/docs/guide_schedule
Note that it deals with scheduling WinSCP script, not a C# application. So just replace
WinSCP.exe
executable with your application.