Blog

Output of following code:

class Program {

static void Main(string[] args) {
var path = @”C:\soln.txt”;
using (FileStream fs = File.Create(path)) {
Byte[] bytes = new UTF8Encoding(true).GetBytes(“Guardado con éxito”);
fs.Write(bytes, 0, bytes.Length);
}

using (StreamReader sr = File.OpenText(path)) {
string s = “”;
while ((s = sr.ReadLine()) != null) {
Console.WriteLine(s);
}
}
}

}