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