Dim uDestPath As String = AppSettings.Get("UnixPath") Dim uWinScpPath As String = AppSettings.Get("WINscpPath") Dim oDecrypt As New ConnObjDecrypt.Decryptor Dim oUnixConStr As Array = oDecrypt.DecryptConnectionString(AppSettings("UnixConString")).Split(";") Dim sFTPServer As String = ReturnValue(oUnixConStr.GetValue(0)) Dim _Host As String = AppSettings.Get("UnixHost") Dim _UserName As String = ReturnValue(oUnixConStr.GetValue(1)) Dim _Password As String = ReturnValue(oUnixConStr.GetValue(2)) Dim logname As String = Path.ChangeExtension(Path.GetTempFileName, "xml") ''create the required startinfo for WinSCP to run in background. Dim startInfo As New ProcessStartInfo startInfo.FileName = uWinScpPath startInfo.RedirectStandardInput = True startInfo.RedirectStandardOutput = True startInfo.UseShellExecute = False startInfo.CreateNoWindow = True startInfo.WindowStyle = ProcessWindowStyle.Hidden ''Start WINscp Dim process As New Process process.StartInfo = startInfo process.Start() ''run the commands ''Open sftp connection with User and Password validations process.StandardInput.WriteLine("option batch abort") process.StandardInput.WriteLine("option confirm off") process.StandardInput.WriteLine("open " + _Host) process.StandardInput.WriteLine(_UserName) process.StandardInput.WriteLine(_Password) process.StandardInput.WriteLine("cd " + uDestPath)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)