Monthly Archives: August 2018

Search files for target text in C#

The .NET tools available in the System.IO namespace and normal string methods make it easy to search files for target text. When you click the Search button, the following code displays the lines in a file that contain a particular … Continue reading

Posted in files | Tagged , , , , , , , | Leave a comment

Write Console window output to multiple places in C#

This example captures output sent to the Console window and displays it in multiple controls plus the Console window. It is based on an excellent reply by user Servy on Stack Overflow. The following class is a TextWriter that represents … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

Redirect Console window output to a TextBox in C#

This example captures output sent to the Console window and displays it in a TextBox control. It is based on an excellent reply by user Servy on Stack Overflow. The Console object has a SetOut method that lets you change … Continue reading

Posted in console | Tagged , , , , , , , , | 1 Comment