StreamWriter sw = new StreamWriter(path, true, Encoding.UTF8); 其中第二个参数true,指是否将数据追加到文件 sw.WriteLine(data); sw.Close();