private int i = 0;
private void save1()
{
FileStream aFile1 = new FileStream("Data1.csv", FileMode.Append);
StreamWriter sw1 = new StreamWriter(aFile1,Encoding.Default);
//10个数据换一行
if (i > 8)
{
m = stext1.Text+ System.Environment.NewLine;
i = 0;
}
else
{
m = stext1.Text + ",";
i++;
}
sw1.Write(m);
sw1.Close();
private int i = 0;
private void save1()
{
FileStream aFile1 = new FileStream("Data1.csv", FileMode.Append);
StreamWriter sw1 = new StreamWriter(aFile1,Encoding.Default);
//10个数据换一行
if (i > 8)
{
m = stext1.Text+ System.Environment.NewLine;
i = 0;
}
else
{
m = stext1.Text + ",";
i++;
}
sw1.Write(m);
sw1.Close();
}
thank you
--------------------编程问答--------------------