G
Guest
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.GetFolderPath(Environment.SpecialFolder.System)
Dim psi As New ProcessStartInfo
psi.FileName = "cmd"
psi.UseShellExecute = False
psi.RedirectStandardOutput = True
psi.RedirectStandardInput = True
Dim p As Process = Process.Start(psi)
Dim iosr As IO.StreamReader = p.StandardOutput
Dim iosw As IO.StreamWriter = p.StandardInput
iosw.Readline(strLine)
iosw.WriteLine("ftp server")
iosw.Readline(strLine)
iosw.WriteLine("user id")
iosw.Readline(strLine)
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 IWshRuntimeLibrary.WshShellClass
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.GetFolderPath(Environment.SpecialFolder.System)
Dim psi As New ProcessStartInfo
psi.FileName = "cmd"
psi.UseShellExecute = False
psi.RedirectStandardOutput = True
psi.RedirectStandardInput = True
Dim p As Process = Process.Start(psi)
Dim iosr As IO.StreamReader = p.StandardOutput
Dim iosw As IO.StreamWriter = p.StandardInput
iosw.Readline(strLine)
iosw.WriteLine("ftp server")
iosw.Readline(strLine)
iosw.WriteLine("user id")
iosw.Readline(strLine)
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 IWshRuntimeLibrary.WshShellClass
wsc.Run("cmd")
But how do you get at the output?