using System;
using System.IO;
namespace IO操作
{
class Program
{
static void Main(string[] args)
{
using(StreamWriter w=File.AppendText("IO.txt"))
{
TextIn("Hello GeoStorm", w);
TextIn("Hello World",w);
w.Close();
}
}
public static void TextIn(string content, TextWriter w)
{
w.Write("\r\n message:");
w.WriteLine("{0}",content);
w.Flush();
}
}
}
C#文件写入操作
关注
打赏