How to read a File to Textreader in C# and VB.NET

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")

Please Share us:
Please rate this snippet

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

Leave a Reply