I am trying to create a VB .NET 2003 Windows application to ftp files to a
server and then open a telnet session on a AIX box to run a remote command
based on parameters from the application form. What is the best way to do
this?
I prefer to not to use FTP files because I do not want to save the password
in a file for security reasons.
I tried to invoke a cmd.com session in a process and redirect standard I/I,
but I can't read all of the ftp input for some reason.
Dim strSysFolder As String =
Environment.Get FolderPath(Envi ronment.Special Folder.System)
Dim psi As New ProcessStartInf o
psi.FileName = "cmd"
psi.UseShellExe cute = False
psi.RedirectSta ndardOutput = True
psi.RedirectSta ndardInput = True
Dim p As Process = Process.Start(p si)
Dim iosr As IO.StreamReader = p.StandardOutpu t
Dim iosw As IO.StreamWriter = p.StandardInput
iosw.Readline(s trLine)
iosw.WriteLine( "ftp server")
iosw.Readline(s trLine)
iosw.WriteLine( "user id")
iosw.Readline(s trLine)
but the text is not always returned from FTP.
Or would using Windows Script Host Object Model be better? Such as
Dim wsc As New IWshRuntimeLibr ary.WshShellCla ss
wsc.Run("cmd")
But how do you get at the output?
server and then open a telnet session on a AIX box to run a remote command
based on parameters from the application form. What is the best way to do
this?
I prefer to not to use FTP files because I do not want to save the password
in a file for security reasons.
I tried to invoke a cmd.com session in a process and redirect standard I/I,
but I can't read all of the ftp input for some reason.
Dim strSysFolder As String =
Environment.Get FolderPath(Envi ronment.Special Folder.System)
Dim psi As New ProcessStartInf o
psi.FileName = "cmd"
psi.UseShellExe cute = False
psi.RedirectSta ndardOutput = True
psi.RedirectSta ndardInput = True
Dim p As Process = Process.Start(p si)
Dim iosr As IO.StreamReader = p.StandardOutpu t
Dim iosw As IO.StreamWriter = p.StandardInput
iosw.Readline(s trLine)
iosw.WriteLine( "ftp server")
iosw.Readline(s trLine)
iosw.WriteLine( "user id")
iosw.Readline(s trLine)
but the text is not always returned from FTP.
Or would using Windows Script Host Object Model be better? Such as
Dim wsc As New IWshRuntimeLibr ary.WshShellCla ss
wsc.Run("cmd")
But how do you get at the output?
Comment