Answers for "c# file open text read"

C#
27

c sharp how to read a text file

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

read file c#

string text = File.ReadAllText(@"c:file.txt", Encoding.UTF8);
Posted by: Guest on November-18-2020

C# Answers by Framework

Browse Popular Code Answers by Language