Poor Man's C Sharp Logger
var message = ".....";
System.IO.File.AppendAllText(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "log.txt"), string.Format("{0}\r\n", message));
Then type %localappdata%
from the Run dialog to display the folder containing log.txt. Or type %localappdata%\log.txt
private static void Log(string format, params object[] parameters)
{
System.IO.File.AppendAllText(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "log.txt"), string.Format(format + "\r\n", parameters));
}
System.IO.File.Delete(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "log.txt"));
System.IO.File.AppendAllText(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "stacklog.txt"), string.Format("{0}\r\n", (new System.Diagnostics.StackTrace()).ToString()));