G'day all

below is a CMD screen shot, of a file Upload to an IBM IS390 Mainframe,
via Command Prompt window (CMD.exe is s must, as .NET Class FTPWebRequest, doesnt cater for IBM IS390 Mainframe Authentication.).
Code:
H:\>ftp
ftp> OPEN 188.66.122.110
Connected to 188.66.122.110.
220-FTPD1 IBM FTP CS V1R4 at MVSHOST2, 08:55:45 on 2007-10-05.
220 Connection will close if idle for more than 5 minutes.
User (188.66.122.110:(none)):
501 User name missing from USER command
Login failed.
ftp> USER STRuSER strPassword
331 Send password please.
230 STRuSER is logged on.  Working directory is "STRuSER.".
ftp> PUT "C:\JSE Margins\JSE Margins Calculator\20070918_TMAP.PPRD.MARGIN\TMAP.P
PRD.MARGIN.INPUT" 'tmap.pprd.margin.input'
200 Port request OK.
125 Storing data set TMAP.PPRD.MARGIN.INPUT
250 Transfer completed successfully.
ftp: 4330380 bytes sent in 70.90Seconds 61.07Kbytes/sec.
ftp> BYE
VB code for the Process (should read p.output, into a msgbox):
vb Code:
  1. Dim p As System.Diagnostics.Process
  2.         Dim pwrite As New ProcessStartInfo
  3.         Dim output As String, sr As StreamReader
  4.         pwrite.UseShellExecute = False
  5.         pwrite.CreateNoWindow = False  'True = no window
  6.         pwrite.RedirectStandardOutput = True  '= no output to read--> can create a problem
  7.         pwrite.FileName = "cmd.exe"
  8.         pwrite.Arguments = "/K ftp -n -s:autoftp.txt"
  9.         Try
  10.             MsgBox("ok to start process")
  11.             p = Process.Start(pwrite)
  12.             output = p.StandardOutput.ReadToEnd
  13.             While Not p.HasExited
  14.                 p.Refresh()
  15.                 Thread.Sleep(100)
  16.                 output = output & p.StandardOutput.ReadToEnd
  17.             End While
  18.             MsgBox("Success Upload")
  19.             MsgBox("output: " & vbNewLine & output)
  20.         Catch ex As Exception
  21.             MsgBox(ex.Message)
  22.         Finally
  23.             MsgBox("got to finally, Closing Process!")
  24.             If Not p Is Nothing Then
  25.                 p.Close()
  26.             End If
  27.         End Try

RESULT:
msgbox pops, showing the text in "AutoFTP.txt" script.

TODO:
how to read output to ensure successfull upload?? (2 red lines in cmd..)



thanks in advance for any suggestion.

Happy Friday

-J.