Results 1 to 7 of 7

Thread: Redirecting Standard Input Output For Telnet Window

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    121

    Redirecting Standard Input Output For Telnet Window

    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?
    Last edited by 2MuchRiceMakesMeSick; Jan 24th, 2006 at 09:03 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width