编程语言
首页 > 编程语言> > C#读写文件的方法为StreamReader和StreanWriter

C#读写文件的方法为StreamReader和StreanWriter

作者:互联网


public static void WriteFile(String str)
{
StreamWriter sw = new StreamWriter("E:/file.txt", true, System.Text.Encoding.Default);
sw.WriteLine(str);
sw.Close();

————————————————

标签:StreamWriter,WriteLine,C#,sw,System,StreanWriter,str,StreamReader
来源: https://www.cnblogs.com/wwhuyulin/p/15895842.html