M
me
public void WriteToLog(string message)
{
StringBuilder bld = new StringBuilder();
bld.AppendFormat(null,"{0} {1}", DateTime.Now.ToString("yy-
MM-dd hh:mm:ss"),message);
StreamWriter sw = File.AppendText(m_LogFile);
sw.WriteLine(bld.ToString());
sw.Flush();
sw.Close();
}
MSDN says all static members in System.IO are thread safe, but here an
object of type StreamWriter is created from AppendText and I'm not
sure...... Do I need critical section or not?
Thanks!
{
StringBuilder bld = new StringBuilder();
bld.AppendFormat(null,"{0} {1}", DateTime.Now.ToString("yy-
MM-dd hh:mm:ss"),message);
StreamWriter sw = File.AppendText(m_LogFile);
sw.WriteLine(bld.ToString());
sw.Flush();
sw.Close();
}
MSDN says all static members in System.IO are thread safe, but here an
object of type StreamWriter is created from AppendText and I'm not
sure...... Do I need critical section or not?
Thanks!