C# .NET - How to append text to Notepad in Console Application

Asked By Ajay Paritala on 14-Nov-12 03:22 PM

How to append text to notepad using C#
I tried  this but it doesn't works

File.AppendAllText(@"C:\Users\vanaajay_p.APOLLO\Desktop\Write.txt", count + "Files get deleted on" + System.DateTime.Now);
and this one too
File.AppendText(@"C:\Users\vanaajay_p.APOLLO\Desktop\Write.txt", count + "Files get deleted on" + System.DateTime.Now);

Ps: I need to append the text daily and i don't want to overwrite previous text in that notepad.

Can some one please help...

Robbe Morris replied to Ajay Paritala on 14-Nov-12 05:28 PM
You keep saying "append text to notepad" but you cannot append text to an application.  The code you have here appends text to a file named Write.txt.

Are you expecting this to be automatically updated in notepad.exe if you have the file opened in the application?  If so, that won't work.