Posted: 2015-10-27 14:45
I am using an SSIS package script task which has reference to winscp.dll and I am using
SessionOptions sessionOptions = new SessionOptions
Protocol = Protocol.Sftp,
HostName = ftpSite,
UserName = username,
Password = password,
SshHostKeyFingerprint = sshKey
using (Session session = new Session())
// WinSCP .NET assembly must be in GAC to be used with SSIS,
// set path to WinSCP.exe explicitly, if using non-default path.
session.ExecutablePath = winscpPath;
session.DisableVersionCheck = true;
session.SessionLogPath = @winSCPLogPath + @"WinscpSessionLog.txt";
session.DebugLogPath = @winSCPLogPath + @"WinscpDebugLog.txt";
session.Timeout = new TimeSpan(0, 2, 0); // two minutes
But here my company does not want SFTP server password to be visible to others(even with the developers). Do we have an option like using the WINSCP client(GUI), we can save a site information(site,username and password) and directly open the FTP session in the scripting by passing SavedSite name?
Location: Prague, Czechia
Save the password anywhere you want (file, registry) and load the password from there. You do not need to hard-code it.
You can post new topics in this forum
And it's free!