1

How can I run and show an exe file (e.g. Telnet) in rich text file in C#? I wanted the rich text file to show what the exe file is showing.

famousgarkin
  • 13,687
  • 5
  • 58
  • 74

2 Answers2

4

Especially regarding to telnet you have two possibilities:

  1. Due to the fact, that telnet is nothing more than sending text over a tcp session you can make your own tcp connection and use it or take some helper class.
  2. The telnet.exe (command line version) uses the standard input and outputs to send and receive data. So you can start the process by the Process class and use a startInfo to redirect them somewhere into your own app. Here you can take this stream, convert it into a string and put it with any formatting you like into a RichTextBox.
Community
  • 1
  • 1
Oliver
  • 43,366
  • 8
  • 94
  • 151
1

You will have to start the exe using System.Diagnostics.Process, and then redirect stdout to your rich text file.

See this article on CodeProject for a good example.

Stuart Grassie
  • 3,043
  • 1
  • 27
  • 36