Answers for "how to print data from a text file in 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
29

c sharp how to read a text file

// To save the text as one string use 'ReadAllText()'
string text = System.IO.File.ReadAllText(@"C:\filepath\file.txt");
// To save each line seperately in an array use 'ReadAllLines()'
string[] lines = System.IO.File.ReadAllLines(@"C:\filepath\file.txt");
Posted by: Guest on February-22-2020

Code answers related to "how to print data from a text file in c#"

C# Answers by Framework

Browse Popular Code Answers by Language