StreamWriter 输出换行符号

来源:互联网 发布:调用接口返回json数据 编辑:程序博客网 时间:2024/04/26 14:37

之前一直用的是“\n”,用记事本不能换行。

查了一下解决方法。

StreamWriter sw = new StreamWriter(@"d:\test.txt");sw.Write("DATA1");sw.Write("\r\n");//换行sw.Write(System.Environment.NewLine); //换行