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

后端 未结 3 1541
甜味超标
甜味超标 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:59

    Write one string at a time using StreamWriter.Write rather than caching everything in a StringBuilder.

提交回复
热议问题