Create StreamWriter from file name : Stream « File Stream « C# / C Sharp
- C# / C Sharp
- File Stream
- Stream
Create StreamWriter from file name
using System;
using System.IO;
public class SWBuff
{
public static void Main(String[] args)
{
string logFile = "a.log";
string fileName = "a.log";
string textToAdd = "asdf";
StreamWriter swFromFileTrue = new StreamWriter(fileName,true);
swFromFileTrue.Write(textToAdd);
swFromFileTrue.Flush();
swFromFileTrue.Close();
}
}
Related examples in the same category