📜  将字符串列表到文件 C# 代码示例

📅  最后修改于: 2022-03-11 14:48:50.358000             🧑  作者: Mango

代码示例1
string[] lines = { "First line", "Second line", "Third line" };
System.IO.File.WriteAllLines(@"C:\Users\Public\TestFolder\WriteLines.txt", lines);
lines = { "Fourth line", "Fith line" };
System.IO.File.AppendAllLines(@"C:\Users\Public\TestFolder\WriteLines.txt", lines);