/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public void LogMessageToFile(string msg) { System.IO.StreamWriter sw = System.IO.File.AppendText("log.txt"); try { string logLine = System.String.Format( "{0:G}: {1}.", System.DateTime.Now, msg); sw.WriteLine(logLine); } finally { sw.Close(); } }