willsmythe37
9/28/2018 - 3:14 PM

C# Writing to a file StreamWriter

Reading from a file.(Kept Adjacent to the .EXE file)

using System;
using System.IO;
class FileWriteDemo
{
 public static void Main()
 {
 StreamWriter writer;
 writer = new StreamWriter("test.txt");
 writer.WriteLine("hello world");
 writer.Close();
 }
}