在添加了打开文件(.csv)应该关闭的数据后,我得到了代码
以下代码:
String filePath = Path.Combine(Directory.GetParent(System.IO.Directory.GetCurrentDirectory()).Parent.FullName,"fetching.csv");
String strSeperator=",";
StringBuilder sbOutput = new StringBuilder();
int env = Convert.ToInt32(textBox1.Text);
int user = Convert.ToInt32(textBox2.Text);
int pass = Convert.ToInt32(textBox3.Text);
int host = Convert.ToInt32(textBox4.Text);
int port = Convert.ToInt32(textBox5.Text);
int service = Convert.ToInt32(textBox6.Text);
int[][] inaOutput = new int[][]{new int[]{env,user,pass,host,port,service}};
int ilength = inaOutput.GetLength(0);
for(int i=0;i<ilength;i++)
sbOutput.AppendLine(String.Join(strSeperator,inaOutput[i]));
File.AppendAllText(filePath,sbOutput.ToString()+"\n");