Answers for "c# read/write text file"

C#
5

write text files with C#

// Create a file to write to.
string createText = "Hello and Welcome" + Environment.NewLine;
File.WriteAllText(path, createText);

...

// Open the file to read from.
string readText = File.ReadAllText(path);
Posted by: Guest on October-23-2020
2

how to read a text file C#

string[] text = System.IO.File.ReadAllLines(@"C:usersusernamefilepathfile.txt");
Posted by: Guest on October-06-2020

C# Answers by Framework

Browse Popular Code Answers by Language