简单C#写日志
public static void WriteLogFile(string strLog)
{
string strPath = System.AppDomain.CurrentDomain.BaseDirectory + http://www.cnblogs.com/haiyu/admin/file://\\zztblog.txt;
FileStream fs = new FileStream(strPath, FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter m_streamWriter = new StreamWriter(fs);
m_streamWriter.BaseStream.Seek(0, SeekOrigin.End);
m_streamWriter.WriteLine(DateTime.Now.ToString() + ": " + strLog);
m_streamWriter.Flush();
m_streamWriter.Close();
fs.Close();
}
一切总是平衡的,这里少,那里补上!