public static void WriteLog(String msg)
{
    StreamWriter writer = null;
    try
    {
        writer = File.AppendText(@"a.log");
        writer.WriteLine("{0} {1}", DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss"), msg);
        writer.Flush();
    }
    catch (Exception ex)
    {
        throw ex;
    }
    finally
    {
        if (writer != null)
        {
            writer.Close();
        }
    }

   
}

相关文章:

  • 2021-11-29
  • 2022-12-23
  • 2021-08-07
  • 2021-10-20
  • 2021-09-08
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
相关资源
相似解决方案