private void SpssToFile(string now, int select, string input, string color, StreamWriter sw) { string[] str = input.Split(' '); for (int i = 0; i < str.Length - select; i++) { int sumAll = 0; string strFile = ""; for (int j = 0; j < select; j++) { if (j <= 1) { sumAll = int.Parse(str[j + i].ToString()); } else { sumAll += int.Parse(str[j + i].ToString()); } if (j == 0) { if (i == 0) { MyGoal.InnerHtml += NewNumber.DisplayStr(now + " ", color); } else { strFile += now + " "; } } if (i == 0) { MyGoal.InnerHtml += NewNumber.DisplayStr(sumAll + " ", color); } else { strFile += sumAll + " "; } } if (i == 0) { MyGoal.InnerHtml += NewNumber.DisplayBROne(); } else { //开始写入 sw.WriteLine(strFile); } } }