Created
January 23, 2016 13:38
-
-
Save anonymous/8944ac41d0fdc15b713d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build the connect string (<user>:<password>@<hostname>) | |
string connectString = @"open " + Dts.Variables["$Package::pServerUserName"].Value.ToString() | |
+ ":" | |
+ Dts.Variables["$Package::pServerUserPassword"].GetSensitiveValue().ToString() | |
+ "@" | |
+ Dts.Variables["$Package::pServerName"].Value.ToString(); | |
// Supplying the host key adds an extra level of security, and avoids getting the prompt to trust the server. | |
string hostKeyString = Dts.Variables["$Package::pServerHostKey"].Value.ToString(); | |
// If hostkey was specified, include it | |
if (hostKeyString != null && hostKeyString.Length > 0) | |
connectString += " -hostkey=\"" + hostKeyString + "\""; | |
// Build the get command string | |
string getString = "get " + Dts.Variables["$Package::pFilename"].Value.ToString(); | |
// Create output variables to capture execution info | |
string outStr = "", errStr = ""; | |
int returnVal = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment