【C#学习笔记】写文件
using System; using System.IO; namespace ConsoleApplication { class Program { static void Main(string[] args) { FileStream file = new FileStream("log.txt", FileMode.OpenOrCreate); StreamWriter sw = new StreamWriter(file); sw.Write("xiaoming"); sw.Close(); } } }