public static void WriterFile(string file)
{
string path = AppDomain.CurrentDomain.BaseDirectory;
//如果不存在,则创建目录
if (!Directory.Exists(path + "Log/"))
{
Directory.CreateDirectory(path + "Log/");
}
FileStream fs = new FileStream(path + "\\Log/log" + DateTime.Now.ToString("yyyyMMdd") + ".txt", FileMode.Append);
StreamWriter streamWriter = new StreamWriter(fs);
streamWriter.BaseStream.Seek(0, SeekOrigin.End);
streamWriter.WriteLine(DateTime.Now.ToString() + " " + file);
streamWriter.Flush();
streamWriter.Close();
fs.Close();
}