保存文件到Excal
static void Main(string[] args)
{
if (!File.Exists(@"C:\Users\Administrator\Desktop\测试精度.csv"))
{
File.Create(@"C:\Users\Administrator\Desktop\测试精度.csv");
}
//string [] contents = new string[3];
string contents1 = "1";
string contents2 = "2";
string contents3 = "3";
//string contents = "1" + "2" + "3" + Environment.NewLine;
string csv = String.Format("{0},{1},{2}"+Environment.NewLine,contents1,contents2,contents3 );
File.AppendAllText(@"C:\Users\Administrator\Desktop\测试精度.csv", csv, Encoding.Default);
}