Answers for "write text file c# .net core"

C#
17

asp.net c# write string to text file

using (StreamWriter writer = new StreamWriter("email.txt", true)) //// true to append data to the file
{
    writer.WriteLine("your_data"); 
}
Posted by: Guest on July-01-2020
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

C# Answers by Framework

Browse Popular Code Answers by Language