How to efficiently write a large text file in C#?

后端 未结 3 1536
甜味超标
甜味超标 2020-12-13 06:09

I am creating a method in C# which generates a text file for a Google Product Feed. The feed will contain upwards of 30,000 records and the text file currently weighs in at

3条回答
  •  借酒劲吻你
    2020-12-13 06:43

    Just move the using statement so it encompasses the whole of your code, and write directly to the file. I see no point in keeping it all in memory first.

提交回复
热议问题