To read a File to Textreader in C# and VB.NET you can use the following snippet.

Sample C#

TextReader reader = File.OpenText(@"C:\dummy.txt");

Sample VB.NET

Dim reader As TextReader = File.OpenText(@"C:\dummy.txt")

One thought on “How to read a File to Textreader in C# and VB.NET”

Leave a Reply