I have a Single File And need to serialize multiple objects randomly. How can I in c#?

后端 未结 3 1769
被撕碎了的回忆
被撕碎了的回忆 2021-01-12 21:53

I have a single file and need to serialize multiple objects of the same class when ever a new object is created. I can\'t store them in arrays as I need to serialize them th

3条回答
  •  孤独总比滥情好
    2021-01-12 22:36

    See answer here.

    In short, just serialize everything to the same file stream, and then deserialize. dotNet would know the size of each object

提交回复
热议问题