File.WriteAllText不保留换行符

此代码的输出

string fileDateTime = "StepsGA-" + DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss") + ".txt"; string fname = System.IO.Path.Combine(System.Environment.CurrentDirectory, fileDateTime); File.WriteAllText(fname, txtSteps.Text); 

不保留换行符。 文本框的所有内容都以横向长线打印! 我哪里出错了? 谢谢 !

得到了答案! 而不是\n我需要使用Environment.NewLine