Can someone tell me why this doesnt work with telnet?
Code:Process p = new Process(); StreamWriter sw; StreamReader sr; StreamReader err; ProcessStartInfo psI = new ProcessStartInfo(@"c:\windows\system32\telnet.exe"); psI.UseShellExecute = false; psI.RedirectStandardInput = true; psI.RedirectStandardOutput = true; psI.RedirectStandardError = true; p.StartInfo = psI; p.Start(); sw = p.StandardInput; sr = p.StandardOutput; err = p.StandardError; sw.Close(); textBox1.Text = sr.ReadToEnd(); textBox1.Text += err.ReadToEnd();
It just opens a cmd prompt really quick and then closes?
Does anyone know how to redirect the I/O of a telnet window?




Reply With Quote