📜  c# 控制台保存文件 - C# 代码示例

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

代码示例1
FileStream filestream = new FileStream("out.txt", FileMode.Create);
var streamwriter = new StreamWriter(filestream);
streamwriter.AutoFlush = true;
Console.SetOut(streamwriter);
Console.SetError(streamwriter);