Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
In my program(console program), I using WinSCP ver. 4.3.8 to upload and download file in a SFTP site/server.
below is my code:
VB
Dim _Host As String = AppSettings.Get("sftp_Host")
          Dim _UserName As String = ReturnValue(oSFTPConStr.GetValue(1))
          Dim _Password As String = ReturnValue(oSFTPConStr.GetValue(2))
          Dim _InboxPath As String = AppSettings.Get("sftp_inFolder")
          Dim _Port As String = AppSettings.Get("sftpPort")

          Dim nPath As String = AppSettings.Get("sftp_Folder")
          Dim nName As String = AppSettings.Get("cTextFileName")

          'create the required startinfo for program to run in background.
          Dim startInfo As New ProcessStartInfo
          startInfo.FileName = _winScppath
          startInfo.RedirectStandardInput = True
          startInfo.RedirectStandardOutput = True
          startInfo.UseShellExecute = False
          startInfo.CreateNoWindow = True
          startInfo.WindowStyle = ProcessWindowStyle.Hidden

          'create the process object.
          Dim process As New Process
          process.StartInfo = startInfo
          process.Start()

          'run the commands
          process.StandardInput.WriteLine("open " + _Host)
          process.StandardInput.WriteLine(_UserName)
          process.StandardInput.WriteLine(_Password)
          Dim ans = process.StandardOutput.ReadLine
          While ans <> Nothing
              If ans.Contains("Session started.") Then
                  ans = ans
                  Exit While
              End If
              ans = process.StandardOutput.ReadLine
          End While
          process.StandardInput.WriteLine("cd " + _InboxPath)
          process.StandardInput.WriteLine(" get " + _InboxFile & " " & _LocalInbox)
          process.StandardInput.Close()
          process.WaitForExit(1)


the program runs on a Job Scheduled task, and were using ASG-Zena to create scheduled run. Zena is a job scheduler.

How can i run my program using Zena Job scheduler ? PLEASE Help Me.
Posted

1 solution

Ask your question with the people who wrote the library. You paid good money for the library and support came with it, use it[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900