Answers for "hhow to read string from txt c#"

C#
5

read text file to string c#

string mystring = System.IO.File.ReadAllText(@"C:\Users\Public\TestFolder\WriteText.txt");
Posted by: Guest on February-26-2021
7

c# read all text from a file

using (StreamReader streamReader = new StreamReader(path_name, Encoding.UTF8))
{
  contents = streamReader.ReadToEnd();
}
Posted by: Guest on April-22-2020
2

c# read from file

string[] lines = File.ReadAllLines(@"c:\file.txt", Encoding.UTF8);
Posted by: Guest on September-21-2021

C# Answers by Framework

Browse Popular Code Answers by Language