string firstString = "this \t is \n a \t line \n are: ";
{
memoryStream.Write(System.Text.Encoding.UTF8.GetBytesSystem.Text.Encoding.UTF8.GetBytes(firstString).Lengt
Button2Click(object sender, EventArgs e) var stopwatch = new Stopwatch();
using (var mem = new MemoryStream如果您直接将所有内容记录到IO文件中,而不使用内存流或任何自定义的日志记录工具,OTOH 与50分钟的File.AppendAllText相比,使用MemoryStream只需花费大约4秒1/2秒的时间