Loading ...

How to read a text file as string in C# | CodeAsp.Net

How to read a text file as string in C#

 /5
0 (0votes)

Assume you have a text file, and you want to read all its contents into a C# string variable. Here is a quick and easy way to do it in just one line of code:

  string text = System.IO.File.ReadAllText("{{path to your text file goes here}}");

Comments (no comments yet)

Top Posts