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();

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

posted @ 2022-02-15 11:54  乌龙茶爱上柠檬汁  阅读(30)  评论(0编辑  收藏  举报