C#读写文件的方法为StreamReader和StreanWriter
public static void WriteFile(String str)
{
StreamWriter sw = new StreamWriter("E:/file.txt", true, System.Text.Encoding.Default);
sw.WriteLine(str);
sw.Close();
————————————————