using System; using System.IO; namespace NotePad.Helper { class WriteNote { public static void Write(string Note, string NoteData) { if (NoteData == "") { FileStream fs = new FileStream(NotePadForm.Folder + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite); fs.Close(); File.WriteAllText(NotePadForm.Folder + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", Note); } else File.WriteAllText(NotePadForm.Folder + NoteData + ".txt", Note); } } }