28 lines
611 B
C#
28 lines
611 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace EmailManager
|
|
{
|
|
public class Log
|
|
{
|
|
private Log() { }
|
|
public Log(string path)
|
|
{
|
|
this.path = path;
|
|
}
|
|
|
|
private string path;
|
|
public void Write(string message)
|
|
{
|
|
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
|
using (StreamWriter sw = File.AppendText(path))
|
|
{
|
|
sw.WriteLine("{0}: {1}", DateTime.Now.ToString(), message);
|
|
}
|
|
}
|
|
}
|
|
}
|