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.
Asked
Active
Viewed 557 times
2 Answers
4
Especially regarding to telnet you have two possibilities:
- 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.
- 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.
-
Thanks people. But I new to C#. Can you show some example? I don't quite get what the codes are saying. – Hibari-sama Jul 12 '10 at 08:11
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
-
Thanks people. But I new to C#. Can you show some example? I don't quite get what the codes are saying. – Hibari-sama Jul 12 '10 at 08:09