How to write contents of an array to a text file? C#

后端 未结 4 886
深忆病人
深忆病人 2021-01-01 04:57

I\'m trying to write the contents of an array to a text file. I\'ve created the file, assigned text boxes to the array (not sure if correctly). Now I want to write the con

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-01 05:34

    You could just do this:

    System.IO.File.WriteAllLines("scores.txt",
        textBoxes.Select(tb => (double.Parse(tb.Text)).ToString()));
    

提交回复
热议问题