标签:
public static void LogFile(string fileName, string log) { FileStream file; if (!File.Exists(fileName)) { file = File.Create(fileName); } else { file = new FileStream(fileName, FileMode.Append, FileAccess.Write, FileShare.ReadWrite); } System.Text.Encoding encode = System.Text.UTF8Encoding.UTF8; var bytes = encode.GetBytes(log); file.Position = file.Length; file.Write(bytes, 0, bytes.Length); file.Flush(); file.Close(); }
换行符:“\n”
标签:
原文地址:http://www.cnblogs.com/ilooking/p/4728792.html