C# - Appending text files

前端 未结 4 2098
遇见更好的自我
遇见更好的自我 2020-12-31 13:24

I have code that reads a file and then converts it to a string, the string is then written to a new file, although could someone demonstrate how to append this string to the

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 13:28

    Try

    StreamWriter writer = File.AppendText("C:\\test.txt");
    writer.WriteLine(mystring);
    

提交回复
热议问题